mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
splited jobprovider into jobrepo, jobcontroller, moved to object db.
This commit is contained in:
parent
97398f604b
commit
40f3a8663d
38 changed files with 635 additions and 634 deletions
39
NzbDrone.Core/Lifecycle/AppRestartJob.cs
Normal file
39
NzbDrone.Core/Lifecycle/AppRestartJob.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
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
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue