Skip to content

Commit 9a6b0f2

Browse files
feat: add timeout for each cleanup process
Add default timeout for each cleanup operation. Set it to 3000ms by default. For each action, you can set the timeout when adding it to the cleanup action list by passing timeout.
1 parent ce2a801 commit 9a6b0f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/detached-processes/cleanup-process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const executeCleanup = async () => {
2727
fileLogService.logData({ message: `Start executing action: ${JSON.stringify(action)}` });
2828

2929
// TODO: Add timeout for each action here
30-
await $childProcess.trySpawnFromCloseEvent(action.command, action.args);
30+
await $childProcess.trySpawnFromCloseEvent(action.command, action.args, {}, { throwError: true, timeout: action.timeout || 3000 });
3131
fileLogService.logData({ message: `Successfully executed action: ${JSON.stringify(action)}` });
3232
} catch (err) {
3333
fileLogService.logData({ message: `Unable to execute action: ${JSON.stringify(action)}`, type: FileLogMessageType.Error });

0 commit comments

Comments
 (0)