소스 검색

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 );
+		} );
 	} );
 }