Markus-Rost пре 4 година
родитељ
комит
153381506c
2 измењених фајлова са 7 додато и 5 уклоњено
  1. 1 0
      bot.js
  2. 6 5
      dashboard/index.js

+ 1 - 0
bot.js

@@ -454,6 +454,7 @@ function graceful(signal) {
 		client.destroy();
 		client.destroy();
 		db.end().then( () => {
 		db.end().then( () => {
 			console.log( '- ' + shardId + ': ' + signal + ': Closed the database connection.' );
 			console.log( '- ' + shardId + ': ' + signal + ': Closed the database connection.' );
+			process.exit(0);
 		}, dberror => {
 		}, dberror => {
 			console.log( '- ' + shardId + ': ' + signal + ': Error while closing the database connection: ' + dberror );
 			console.log( '- ' + shardId + ': ' + signal + ': Error while closing the database connection: ' + dberror );
 		} );
 		} );

+ 6 - 5
dashboard/index.js

@@ -230,11 +230,12 @@ function graceful(signal) {
 	console.log( '- Dashboard: ' + signal + ': Closing the dashboard...' );
 	console.log( '- Dashboard: ' + signal + ': Closing the dashboard...' );
 	server.close( () => {
 	server.close( () => {
 		console.log( '- Dashboard: ' + signal + ': Closed the dashboard server.' );
 		console.log( '- Dashboard: ' + signal + ': Closed the dashboard server.' );
-	} );
-	db.end().then( () => {
-		console.log( '- Dashboard: ' + signal + ': Closed the database connection.' );
-	}, dberror => {
-		console.log( '- Dashboard: ' + signal + ': Error while closing the database connection: ' + dberror );
+		db.end().then( () => {
+			console.log( '- Dashboard: ' + signal + ': Closed the database connection.' );
+			process.exit(0);
+		}, dberror => {
+			console.log( '- Dashboard: ' + signal + ': Error while closing the database connection: ' + dberror );
+		} );
 	} );
 	} );
 }
 }