.die should work properly now

This commit is contained in:
Master Kwoth 2017-10-22 16:09:51 +02:00
parent 082e2fbe2d
commit 062a4bcc20
2 changed files with 6 additions and 1 deletions

View File

@ -317,7 +317,8 @@ namespace NadekoBot.Modules.Administration
// ignored // ignored
} }
await Task.Delay(2000).ConfigureAwait(false); await Task.Delay(2000).ConfigureAwait(false);
Environment.Exit(0); var sub = _cache.Redis.GetSubscriber();
sub.Publish(_creds.RedisKey() + "_die", "", StackExchange.Redis.CommandFlags.FireAndForget);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]

View File

@ -65,6 +65,10 @@ namespace NadekoBot.Core.Services
sub.Subscribe(_key + "_shardcoord_stop", sub.Subscribe(_key + "_shardcoord_stop",
OnStop, OnStop,
CommandFlags.FireAndForget); CommandFlags.FireAndForget);
sub.Subscribe(_key + "_die",
(ch, x) => Environment.Exit(0),
CommandFlags.FireAndForget);
} }
private void OnStop(RedisChannel ch, RedisValue data) private void OnStop(RedisChannel ch, RedisValue data)