mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(gateway): initial commit
This commit is contained in:
parent
8e5b987b2c
commit
fadf007abc
12 changed files with 2487 additions and 1 deletions
|
|
@ -74,7 +74,12 @@ public class Init
|
|||
|
||||
// Start the Discord shards themselves (handlers already set up)
|
||||
logger.Information("Connecting to Discord");
|
||||
await StartCluster(services);
|
||||
|
||||
if (config.RedisGatewayUrl != null)
|
||||
await services.Resolve<RedisGatewayService>().Start();
|
||||
else
|
||||
await StartCluster(services);
|
||||
|
||||
logger.Information("Connected! All is good (probably).");
|
||||
|
||||
// Lastly, we just... wait. Everything else is handled in the DiscordClient event loop
|
||||
|
|
@ -98,6 +103,7 @@ public class Init
|
|||
// - Wraps the given function in an exception handler that properly logs errors
|
||||
// - Adds a SIGINT (Ctrl-C) listener through Console.CancelKeyPress to gracefully shut down
|
||||
// - Adds a SIGTERM (kill, systemctl stop, docker stop) listener through AppDomain.ProcessExit (same as above)
|
||||
// todo: move run-clustered.sh to here
|
||||
var logger = services.Resolve<ILogger>().ForContext<Init>();
|
||||
|
||||
var shutdown = new TaskCompletionSource<object>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue