fix: include shard_id in redis channel
This commit is contained in:
@@ -79,11 +79,7 @@ public class Init
|
||||
|
||||
// Start the Discord shards themselves (handlers already set up)
|
||||
logger.Information("Connecting to Discord");
|
||||
|
||||
if (config.RedisGatewayUrl != null)
|
||||
await services.Resolve<RedisGatewayService>().Start();
|
||||
else
|
||||
await StartCluster(services);
|
||||
await StartCluster(services);
|
||||
|
||||
logger.Information("Connected! All is good (probably).");
|
||||
|
||||
@@ -189,7 +185,15 @@ public class Init
|
||||
var shardMin = (int)Math.Round(totalShards * (float)nodeIndex / totalNodes);
|
||||
var shardMax = (int)Math.Round(totalShards * (float)(nodeIndex + 1) / totalNodes) - 1;
|
||||
|
||||
await cluster.Start(info.Url, shardMin, shardMax, totalShards, info.SessionStartLimit.MaxConcurrency, redis.Connection);
|
||||
if (config.RedisGatewayUrl != null)
|
||||
{
|
||||
var shardService = services.Resolve<RedisGatewayService>();
|
||||
|
||||
for (var i = shardMin; i <= shardMax; i++)
|
||||
await shardService.Start(i);
|
||||
}
|
||||
else
|
||||
await cluster.Start(info.Url, shardMin, shardMax, totalShards, info.SessionStartLimit.MaxConcurrency, redis.Connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user