Browse Source

新增。rust仓位检查接口

hl 8 months ago
parent
commit
c1e6b66f43
1 changed files with 28 additions and 18 deletions
  1. 28 18
      src/robot.js

+ 28 - 18
src/robot.js

@@ -381,25 +381,32 @@ async function closeAppAll() {
 
         var appMap = getAppMap()
         // console.log(appMap.size); // 输出Map的大小
-        appMap.forEach((value, key) => {
-            console.log(key, value); // 输出Map的键值对
-            // logger.info("???", key, value)
-            var app = value
-            logger.info(` 信号:  `, app.threadStatus);
-            /*******新的删除方式*************/
-            //文件授权
-            if (app.childProcess !== undefined) {
-                var pid = app.childProcess.pid
-                exec(`sudo kill ${pid}`, (error, stdout, stderr) => {
-                    if (error) {
-                        logger.error(`进程${pid} 杀死失败: ${error}`);
-                    }
-                    logger.info(`进程${pid} 杀死成功`);
-                    // logger.info(`当前app:`, app);
-                    app.threadStatus = RobotStatus.STOP_PENDING
-                    robotStatus(app)
-                });
+        // appMap.forEach((value, key) => {
+        //     console.log(key, value); // 输出Map的键值对
+        //     // logger.info("???", key, value)
+        //     var app = value
+        //     logger.info(` 信号:  `, app.threadStatus);
+        //     /*******新的删除方式*************/
+        //     //文件授权
+        //     if (app.childProcess !== undefined) {
+        //         var pid = app.childProcess.pid
+        //         exec(`sudo kill ${pid}`, (error, stdout, stderr) => {
+        //             if (error) {
+        //                 logger.error(`进程${pid} 杀死失败: ${error}`);
+        //             }
+        //             logger.info(`进程${pid} 杀死成功`);
+        //             // logger.info(`当前app:`, app);
+        //             app.threadStatus = RobotStatus.STOP_PENDING
+        //             robotStatus(app)
+        //         });
+        //     }
+        // });
+
+        exec(`sudo pkill 4l_as`, (error, stdout, stderr) => {
+            if (error) {
+                logger.error(`4l_as杀死失败: ${error}`);
             }
+            logger.info(`4l_as 杀死成功`);
         });
 
         while (true) {
@@ -527,6 +534,9 @@ function delRobot(app) {
     //     delApp(app.id)
     // }
 }
+//----------------------------------------------
+//----------------------------------------------
+
 
 
 module.exports = {