- Bot now takes shard id (optional) and total shards (optional) command line arguments (changed from shard id and parent process id)

- Sharding with coordinator now works properly
- Documented creds.yml RestartCommand - it has no effect when coordinator is starting the bot
- Regenerated creds_example.yml
- Removed all db migrators as the v3 requires the user to have updated 2.x all the way
- TotalShards in creds.yml gets overriden by coord.yml's TotalShards if the bot is ran through coordinator (more precisely, by the command line argument to the bot)
- Coordinator now runs on http://localhost:3442 by default, you can change this in appsettings.json
    - This is done because of macos https issues
    - Primarily because https for regular users is a massive hassle. Coordinator shouldn't be exposed anyway
- Minor cleanup
This commit is contained in:
Kwoth
2021-06-25 19:14:34 +02:00
parent a1ef862382
commit 670b0aca96
14 changed files with 119 additions and 398 deletions

View File

@@ -79,7 +79,7 @@ namespace NadekoBot.Coordinator
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
Log.Information("Executing");
// Log.Information("Executing");
bool first = true;
while (!stoppingToken.IsCancellationRequested)
@@ -98,7 +98,7 @@ namespace NadekoBot.Coordinator
if (first)
{
Log.Information("Startup order: {StartupOrder}",string.Join(' ', shardIds));
// Log.Information("Startup order: {StartupOrder}",string.Join(' ', shardIds));
first = false;
}
@@ -192,7 +192,7 @@ namespace NadekoBot.Coordinator
FileName = _config.ShardStartCommand,
Arguments = string.Format(_config.ShardStartArgs,
shardId,
Environment.ProcessId),
_config.TotalShards),
EnvironmentVariables =
{
{"NADEKOBOT_IS_COORDINATED", "1"}

View File

@@ -5,16 +5,5 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
},
"Endpoints": {
"Http": {
"Url": "https://localhost:3443"
}
}
}
}

View File

@@ -13,7 +13,7 @@
},
"Endpoints": {
"Http": {
"Url": "http://localhost:3443"
"Url": "http://localhost:3442"
}
}
}

View File

@@ -1,5 +1,5 @@
TotalShards: 1
TotalShards: 3
RecheckIntervalMs: 5000
ShardStartCommand: dotnet
ShardStartArgs: run -p "..\NadekoBot\NadekoBot.csproj" --no-build -- {0}
ShardStartArgs: run -p "..\NadekoBot\NadekoBot.csproj" --no-build -- {0} {1}
UnresponsiveSec: 30