mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 18:28:27 -04:00
Restructured folders and project names, ci should be fixed
This commit is contained in:
34
src/NadekoBot.Coordinator/Program.cs
Normal file
34
src/NadekoBot.Coordinator/Program.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using NadekoBot.Core.Services;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NadekoBot
|
||||
{
|
||||
public sealed class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var pid = Process.GetCurrentProcess().Id;
|
||||
System.Console.WriteLine($"Pid: {pid}");
|
||||
if (args.Length == 2
|
||||
&& int.TryParse(args[0], out int shardId)
|
||||
&& int.TryParse(args[1], out int parentProcessId))
|
||||
{
|
||||
await new NadekoBot(shardId, parentProcessId == 0 ? pid : parentProcessId)
|
||||
.RunAndBlockAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
await new ShardsCoordinator()
|
||||
.RunAsync()
|
||||
.ConfigureAwait(false);
|
||||
#if DEBUG
|
||||
await new NadekoBot(0, pid)
|
||||
.RunAndBlockAsync();
|
||||
#else
|
||||
await Task.Delay(-1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user