修复任务详情查看脚本错误

This commit is contained in:
whyour
2024-05-25 18:22:01 +08:00
parent e77d4c4337
commit 805a716033
5 changed files with 32 additions and 30 deletions
+5 -2
View File
@@ -41,7 +41,7 @@ export default class ScriptService {
const relativePath = path.relative(config.scriptPath, filePath);
const command = `${TASK_COMMAND} ${relativePath} now`;
const pid = await this.scheduleService.runTask(
command,
`real_time=true ${command}`,
this.taskCallbacks(filePath),
{ command },
'start',
@@ -63,7 +63,10 @@ export default class ScriptService {
}
public async getFile(filePath: string, fileName: string) {
const _filePath = join(config.scriptPath, filePath, fileName);
let _filePath = join(config.scriptPath, filePath, fileName);
if (filePath.startsWith(config.dataPath)) {
_filePath = join(filePath, fileName);
}
const content = await getFileContentByName(_filePath);
return content;
}