Jackett/src/Jackett.Service/Service.cs

30 lines
740 B
C#
Raw Normal View History

using Jackett.Common.Models.Config;
2015-07-19 00:27:41 +00:00
using System.ServiceProcess;
using Jackett.Common;
2015-07-19 00:27:41 +00:00
namespace Jackett.Service
{
public partial class Service : ServiceBase
{
public Service()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
Engine.BuildContainer(new RuntimeSettings(), new WebApi2Module());
2017-11-08 15:06:13 +00:00
Engine.Logger.Info("Service starting");
Engine.Server.Initalize();
2015-07-19 13:22:50 +00:00
Engine.Server.Start();
Engine.Logger.Info("Service started");
2015-07-19 00:27:41 +00:00
}
protected override void OnStop()
{
2015-07-19 13:22:50 +00:00
Engine.Logger.Info("Service stopping");
Engine.Server.Stop();
2015-07-19 00:27:41 +00:00
}
}
}