mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Merge branch 'exit-code' into 'v5'
Exit with status code 0 on graceful shutdowns See merge request Kwoth/nadekobot!334
This commit is contained in:
@@ -218,12 +218,12 @@ public sealed class Bot : IBot
|
|||||||
catch (HttpException ex)
|
catch (HttpException ex)
|
||||||
{
|
{
|
||||||
LoginErrorHandler.Handle(ex);
|
LoginErrorHandler.Handle(ex);
|
||||||
Helpers.ReadErrorAndExit(3);
|
Helpers.ReadErrorAndExit(101);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LoginErrorHandler.Handle(ex);
|
LoginErrorHandler.Handle(ex);
|
||||||
Helpers.ReadErrorAndExit(4);
|
Helpers.ReadErrorAndExit(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
await clientReady.Task.ConfigureAwait(false);
|
await clientReady.Task.ConfigureAwait(false);
|
||||||
@@ -275,7 +275,7 @@ public sealed class Bot : IBot
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "Error adding services");
|
Log.Error(ex, "Error adding services");
|
||||||
Helpers.ReadErrorAndExit(9);
|
Helpers.ReadErrorAndExit(103);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Information("Shard {ShardId} connected in {Elapsed:F2}s",
|
Log.Information("Shard {ShardId} connected in {Elapsed:F2}s",
|
||||||
|
@@ -82,7 +82,7 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
|||||||
if (string.IsNullOrWhiteSpace(_creds.Token))
|
if (string.IsNullOrWhiteSpace(_creds.Token))
|
||||||
{
|
{
|
||||||
Log.Error("Token is missing from creds.yml or Environment variables.\nAdd it and restart the program");
|
Log.Error("Token is missing from creds.yml or Environment variables.\nAdd it and restart the program");
|
||||||
Helpers.ReadErrorAndExit(5);
|
Helpers.ReadErrorAndExit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ public class RemoteGrpcCoordinator : ICoordinator, IReadyExecutor
|
|||||||
await Task.Delay(7500);
|
await Task.Delay(7500);
|
||||||
}
|
}
|
||||||
|
|
||||||
Environment.Exit(5);
|
Environment.Exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@@ -33,7 +33,7 @@ public class SingleProcessCoordinator : ICoordinator
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Die(bool graceful = false)
|
public void Die(bool graceful = false)
|
||||||
=> Environment.Exit(5);
|
=> Environment.Exit(0);
|
||||||
|
|
||||||
public bool RestartShard(int shardId)
|
public bool RestartShard(int shardId)
|
||||||
=> RestartBot();
|
=> RestartBot();
|
||||||
|
Reference in New Issue
Block a user