-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
36 lines (32 loc) · 998 Bytes
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using BSS.Logging;
using System;
using System.ServiceProcess;
#pragma warning disable IDE0079
#pragma warning disable CS0618
#pragma warning disable CS8618
namespace Wrapper
{
internal static partial class Worker
{
internal static String _assemblyPath;
private static void Main(String[] args)
{
_assemblyPath = Log.Initialize();
#if DEBUG
Log.FastLog("Starting in debug mode", LogSeverity.Debug, "Main");
Console.CancelKeyPress += (s, e) =>
{
e.Cancel = true;
Service.MainThread.Resume();
Service.MainThread.Join();
Environment.Exit(0);
};
Log.FastLog("Starting nginx", LogSeverity.Debug, "Main");
Service.MainThread.Start();
#else
Log.FastLog("Starting service base", LogSeverity.Info, "Main");
ServiceBase.Run(new Service());
#endif
}
}
}