|
@@ -35,6 +35,7 @@ manager.on( 'shardCreate', shard => {
|
|
if ( message === 'SIGKILL' ) {
|
|
if ( message === 'SIGKILL' ) {
|
|
console.log( '\n- Killing all shards!\n\n' );
|
|
console.log( '\n- Killing all shards!\n\n' );
|
|
manager.shards.forEach( shard => shard.kill() );
|
|
manager.shards.forEach( shard => shard.kill() );
|
|
|
|
+ if ( typeof server !== 'undefined' ) server.kill();
|
|
}
|
|
}
|
|
if ( message === 'postStats' && process.env.botlist ) postStats();
|
|
if ( message === 'postStats' && process.env.botlist ) postStats();
|
|
} );
|
|
} );
|
|
@@ -157,7 +158,7 @@ function postStats(botList = JSON.parse(process.env.botlist), shardCount = manag
|
|
* End the process gracefully.
|
|
* End the process gracefully.
|
|
* @param {NodeJS.Signals} signal - The signal received.
|
|
* @param {NodeJS.Signals} signal - The signal received.
|
|
*/
|
|
*/
|
|
-async function graceful(signal) {
|
|
|
|
|
|
+function graceful(signal) {
|
|
console.log( '- ' + signal + ': Disabling respawn...' );
|
|
console.log( '- ' + signal + ': Disabling respawn...' );
|
|
manager.respawn = false;
|
|
manager.respawn = false;
|
|
}
|
|
}
|
|
@@ -176,5 +177,5 @@ if ( isDebug && process.argv[3]?.startsWith( '--timeout:' ) ) {
|
|
console.log( `\n- Running for ${timeout} seconds, closing process!\n` );
|
|
console.log( `\n- Running for ${timeout} seconds, closing process!\n` );
|
|
manager.shards.forEach( shard => shard.kill() );
|
|
manager.shards.forEach( shard => shard.kill() );
|
|
if ( typeof server !== 'undefined' ) server.kill();
|
|
if ( typeof server !== 'undefined' ) server.kill();
|
|
- }, timeout * 1000 ).unref();
|
|
|
|
|
|
+ }, timeout * 1000 ).unref();
|
|
}
|
|
}
|