浏览代码

fix closing

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();
 		db.end().then( () => {
 			console.log( '- ' + shardId + ': ' + signal + ': Closed the database connection.' );
+			process.exit(0);
 		}, 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...' );
 	server.close( () => {
 		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 );
+		} );
 	} );
 }