Jackett/src/Jackett.Service/Service.cs

36 lines
849 B
C#
Raw Normal View History

2015-07-19 00:27:41 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace Jackett.Service
{
public partial class Service : ServiceBase
{
public Service()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
Engine.BuildContainer(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
}
}
}