1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Core/Jobs/AppRestartJob.cs
2013-02-17 08:23:53 -08:00

38 lines
911 B
C#

using System;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Jobs
{
public class AppRestartJob : IJob
{
private readonly IISProvider _iisProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public AppRestartJob(IISProvider iisProvider)
{
_iisProvider = iisProvider;
}
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");
_iisProvider.StopServer();
}
}
}