1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-13 22:43:35 +01:00
Radarr/NzbDrone.Core/Lifecycle/AppRestartJob.cs

39 lines
965 B
C#
Raw Normal View History

using System;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Lifecycle
{
public class AppRestartJob : IJob
{
2013-02-19 02:57:08 +01:00
private readonly IHostController _hostController;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
2013-02-19 02:57:08 +01:00
public AppRestartJob(IHostController hostController)
{
2013-02-19 02:13:42 +01:00
_hostController = hostController;
}
public string Name
{
get { return "Restart NzbDrone"; }
}
public TimeSpan DefaultInterval
{
get { return TimeSpan.FromTicks(0); }
}
public virtual void Start(ProgressNotification notification, dynamic options)
{
notification.CurrentMessage = "Restarting NzbDrone";
logger.Info("Restarting NzbDrone");
2013-02-19 02:13:42 +01:00
_hostController.StopServer();
}
}
}