Browse Source

关机日志提醒

hl 11 months ago
parent
commit
eeda8fe9fb
1 changed files with 2 additions and 0 deletions
  1. 2 0
      client.js

+ 2 - 0
client.js

@@ -36,9 +36,11 @@ process.on('SIGINT', () => {
 // 监听SIGTERM信号(通常是系统请求进程终止)
 process.on('SIGTERM', async () => {
     logger.info('收到SIGTERM信号,准备退出...');
+    logger.info('关机前的一些操作...');
     // 关机前为了防止 node 更新,需要吧map 里面的pid 写在本地文件
     await robot.closeAppAll()
 
+    logger.info('自我关闭~~...');
     // 在这里执行清理工作
     process.exit(); // 这将触发exit事件
 });