mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: don't require Redis for startup
This commit is contained in:
parent
8964d7f623
commit
fc8f1b7cd3
4 changed files with 22 additions and 11 deletions
|
|
@ -42,12 +42,14 @@ public class Init
|
|||
opts.DisableTaskUnobservedTaskExceptionCapture();
|
||||
});
|
||||
|
||||
// initialize Redis
|
||||
var coreConfig = services.Resolve<CoreConfig>();
|
||||
var redis = services.Resolve<RedisService>();
|
||||
await redis.InitAsync(coreConfig);
|
||||
|
||||
var config = services.Resolve<BotConfig>();
|
||||
var coreConfig = services.Resolve<CoreConfig>();
|
||||
|
||||
// initialize Redis
|
||||
var redis = services.Resolve<RedisService>();
|
||||
if (config.UseRedisRatelimiter)
|
||||
await redis.InitAsync(coreConfig);
|
||||
|
||||
if (config.Cluster == null)
|
||||
{
|
||||
// "Connect to the database" (ie. set off database migrations and ensure state)
|
||||
|
|
@ -55,7 +57,8 @@ public class Init
|
|||
await services.Resolve<IDatabase>().ApplyMigrations();
|
||||
|
||||
// Clear shard status from Redis
|
||||
await redis.Connection.GetDatabase().KeyDeleteAsync("pluralkit:shardstatus");
|
||||
if (redis.Connection != null)
|
||||
await redis.Connection.GetDatabase().KeyDeleteAsync("pluralkit:shardstatus");
|
||||
}
|
||||
|
||||
// Init the bot instance itself, register handlers and such to the client before beginning to connect
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue