mirror of
https://github.com/Radarr/Radarr
synced 2024-12-29 11:25:26 +00:00
40 lines
No EOL
1,001 B
C#
40 lines
No EOL
1,001 B
C#
using System;
|
|
using System.Linq;
|
|
using NLog;
|
|
using NzbDrone.Common;
|
|
using NzbDrone.Core.Jobs;
|
|
using NzbDrone.Core.Jobs.Framework;
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
namespace NzbDrone.Core.Lifecycle
|
|
{
|
|
public class AppRestartJob : IJob
|
|
{
|
|
private readonly IHostController _hostController;
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public AppRestartJob(IHostController hostController)
|
|
{
|
|
_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");
|
|
|
|
_hostController.StopServer();
|
|
}
|
|
}
|
|
} |