mirror of
https://github.com/DreamExposure/DisCal-Discord-Bot.git
synced 2026-02-09 04:49:22 -06:00
Add ability to disable restart service
Sometimes it will be needed to not auto restart shards, so this adds the ability to prevent the API server from forcing shard restarts.
This commit is contained in:
@@ -41,7 +41,7 @@ public enum BotSettings {
|
||||
|
||||
DEBUG_WEBHOOK, ERROR_WEBHOOK, STATUS_WEBHOOK,
|
||||
|
||||
USE_REDIS_STORES, USE_WEBHOOKS, UPDATE_SITES,
|
||||
USE_REDIS_STORES, USE_WEBHOOKS, UPDATE_SITES, USE_RESTART_SERVICE,
|
||||
|
||||
BOT_API_TOKEN,
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ public class NetworkMediator {
|
||||
}
|
||||
|
||||
private String issueRestart(final ConnectedClient c) {
|
||||
if (!"true".equalsIgnoreCase(BotSettings.USE_RESTART_SERVICE.get())) {
|
||||
DisCalServer.getNetworkInfo().removeClient(c.getClientIndex(), "Restart service not active!");
|
||||
return "INACTIVE";
|
||||
}
|
||||
|
||||
try {
|
||||
final Session session = this.createSession(c.getIpForRestart(), c.getPortForRestart());
|
||||
session.connect();
|
||||
|
||||
Reference in New Issue
Block a user