修改订阅执行逻辑

This commit is contained in:
whyour
2022-06-01 00:25:32 +08:00
parent 5a01c41bbb
commit b82c630e3f
2 changed files with 14 additions and 4 deletions
+3
View File
@@ -18,6 +18,7 @@ interface ScheduleTaskType {
}
export interface TaskCallbacks {
onBefore?: (startTime: dayjs.Dayjs) => Promise<void>;
onStart?: (
cp: ChildProcessWithoutNullStreams,
startTime: dayjs.Dayjs,
@@ -45,6 +46,8 @@ export default class ScheduleService {
return new Promise(async (resolve, reject) => {
try {
const startTime = dayjs();
await callbacks.onBefore?.(startTime);
const cp = spawn(command, { shell: '/bin/bash' });
// TODO: