mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Added graceful option to die (kill coordinator without killing shards)
This commit is contained in:
@@ -318,7 +318,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[OwnerOnly]
|
[OwnerOnly]
|
||||||
public async Task Die()
|
public async Task Die(bool graceful = false)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -329,7 +329,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
await Task.Delay(2000).ConfigureAwait(false);
|
await Task.Delay(2000).ConfigureAwait(false);
|
||||||
_coord.Die();
|
_coord.Die(graceful);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
|
@@ -7,7 +7,7 @@ namespace NadekoBot.Services
|
|||||||
public interface ICoordinator
|
public interface ICoordinator
|
||||||
{
|
{
|
||||||
bool RestartBot();
|
bool RestartBot();
|
||||||
void Die();
|
void Die(bool graceful);
|
||||||
bool RestartShard(int shardId);
|
bool RestartShard(int shardId);
|
||||||
IList<ShardStatus> GetAllShardStatuses();
|
IList<ShardStatus> GetAllShardStatuses();
|
||||||
int GetGuildCount();
|
int GetGuildCount();
|
||||||
|
@@ -39,11 +39,11 @@ namespace NadekoBot.Services
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Die()
|
public void Die(bool graceful)
|
||||||
{
|
{
|
||||||
_coordClient.Die(new DieRequest()
|
_coordClient.Die(new DieRequest()
|
||||||
{
|
{
|
||||||
Graceful = false
|
Graceful = graceful
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ namespace NadekoBot.Services
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Die()
|
public void Die(bool graceful = false)
|
||||||
{
|
{
|
||||||
Environment.Exit(5);
|
Environment.Exit(5);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user