修复调试脚本日志

This commit is contained in:
whyour
2022-12-06 00:22:05 +08:00
parent 310ce55b09
commit 3b389259c1
2 changed files with 13 additions and 14 deletions
+2 -8
View File
@@ -43,9 +43,10 @@ export default class ScriptService {
public async runScript(filePath: string) {
const relativePath = path.relative(config.scriptPath, filePath);
const command = `task -l ${relativePath} now`;
const pid = this.scheduleService.runTask(
const pid = await this.scheduleService.runTask(
command,
this.taskCallbacks(filePath),
'start',
);
return { code: 200, data: pid };
@@ -61,13 +62,6 @@ export default class ScriptService {
await killTask(pid);
} catch (error) {}
this.sockService.sendMessage({
type: 'manuallyRunScript',
message: `${str}\n## 执行结束... ${new Date()
.toLocaleString('zh', { hour12: false })
.replace(' 24:', ' 00:')}${LOG_END_SYMBOL}`,
});
return { code: 200 };
}
}