瀏覽代碼

MACOS version

Naibo Wang 2 年之前
父節點
當前提交
414ad5e01f
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 二進制
      .DS_Store
  2. 3 2
      ElectronJS/server.js

二進制
.DS_Store


+ 3 - 2
ElectronJS/server.js

@@ -178,7 +178,9 @@ exports.start = function(port = 8074) {
                     file_names = [];
                     fs.readdirSync(path.join(getDir(), "tasks")).forEach((file)=>{
                         try{
-                            file_names.push(parseInt(file.split(".")[0]));
+                            if(file.split(".")[1] == "json"){
+                                file_names.push(parseInt(file.split(".")[0]));
+                            }
                         } catch (error) {
 
                         }
@@ -240,7 +242,6 @@ exports.start = function(port = 8074) {
                 if (file_names.length != 0) {
                     eid = Math.max(...file_names) + 1;
                 }
-                console.log(file_names);
                 task["id"] = eid;
                 task = JSON.stringify(task);
                 fs.writeFile(path.join(getDir(), `execution_instances/${eid}.json`), task, (err) => {});