feat: RestartCommand

This commit is contained in:
ChomeNS
2024-12-17 16:36:35 +07:00
parent 2340991012
commit 36fa5b3f9b
6 changed files with 42 additions and 7 deletions

View File

@@ -104,7 +104,7 @@ public class Main {
// no need to reset backupFailTimes because we are stopping anyway
stop();
stop(0);
}
}, 0, config.backup.interval, TimeUnit.MILLISECONDS);
}
@@ -139,7 +139,7 @@ public class Main {
}
// most of these are stolen from HBot
public static void stop () {
public static void stop (int exitCode) {
if (stopping) return;
stopping = true;
@@ -199,6 +199,6 @@ public class Main {
}
}
System.exit(0);
System.exit(exitCode);
}
}