mirror of https://github.com/Jackett/Jackett
Remove Jackett.Service.Windows
No longer needed now that Jackett.Service covers both scenarios
This commit is contained in:
parent
4970219ea7
commit
ca1af97e42
|
@ -1,13 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyName>JackettService</AssemblyName>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Jackett.Server\Jackett.Server.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,17 +0,0 @@
|
|||
using System.ServiceProcess;
|
||||
|
||||
namespace Jackett.Service.Windows
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private static void Main()
|
||||
{
|
||||
ServiceBase[] ServicesToRun;
|
||||
ServicesToRun = new ServiceBase[]
|
||||
{
|
||||
new Service()
|
||||
};
|
||||
ServiceBase.Run(ServicesToRun);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
using Jackett.Server;
|
||||
using System.ServiceProcess;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jackett.Service.Windows
|
||||
{
|
||||
public class Service : ServiceBase
|
||||
{
|
||||
private CancellationTokenSource tokenSource = new CancellationTokenSource();
|
||||
|
||||
protected override void OnStart(string[] args)
|
||||
{
|
||||
CancellationToken token = tokenSource.Token;
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
//Registering callback that would cancel downloading
|
||||
token.Register(() => Helper.StopWebHost());
|
||||
Jackett.Server.Program.Main(new string[0]);
|
||||
}, token);
|
||||
}
|
||||
|
||||
protected override void OnStop()
|
||||
{
|
||||
tokenSource.Cancel(true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue