Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit a1df59e

Browse files
committed
修复 计划任务错误捕获
1 parent 7110fe0 commit a1df59e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/service/system_instance_control.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,26 +165,26 @@ class InstanceControlSubsystem {
165165
// logger.info(`执行计划任务: ${task.name} ${task.action} ${task.time} ${task.count} `);
166166
if (task.action === "start") {
167167
if (instanceStatus === 0) {
168-
instance.exec(new StartCommand("ScheduleJob"));
168+
return await instance.exec(new StartCommand("ScheduleJob"));
169169
}
170170
}
171171
if (task.action === "stop") {
172172
if (instanceStatus === 3) {
173-
instance.exec(new StopCommand());
173+
return await instance.exec(new StopCommand());
174174
}
175175
}
176176
if (task.action === "restart") {
177177
if (instanceStatus === 3) {
178-
instance.exec(new RestartCommand());
178+
return await instance.exec(new RestartCommand());
179179
}
180180
}
181181
if (task.action === "command") {
182182
if (instanceStatus === 3) {
183-
instance.exec(new SendCommand(payload));
183+
return await instance.exec(new SendCommand(payload));
184184
}
185185
}
186186
if (task.action === "kill") {
187-
instance.exec(new KillCommand());
187+
return await instance.exec(new KillCommand());
188188
}
189189
} catch (error) {
190190
logger.error(`实例 ${task.instanceUuid} 计划任务 ${task.name} 执行错误: \n ${error} `);

0 commit comments

Comments
 (0)