Skip to content

Commit 4f812bd

Browse files
committed
fix: make cleanup function sync
1 parent e77ec24 commit 4f812bd

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

apps/execution-service/src/execution/execution.service.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export class ExecutionService {
5858
}
5959

6060
// Cleanup function
61-
const cleanup = async () => {
61+
const cleanup = () => {
6262
try {
63-
await fs.rm(tempDir, { recursive: true, force: true });
63+
fsSync.rmSync(tempDir, { recursive: true, force: true });
6464
} catch (error) {
6565
console.error('Cleanup error:', error);
6666
}
@@ -149,21 +149,22 @@ export class ExecutionService {
149149
if (compileCommand) {
150150
executeProcess(compileCommand, (compileResult) => {
151151
if (!compileResult.success) {
152-
cleanup().finally(() => {
153-
resolve({
154-
success: false,
155-
output: 'Compilation Error: ' + compileResult.output,
156-
});
152+
cleanup();
153+
resolve({
154+
success: false,
155+
output: 'Compilation Error: ' + compileResult.output,
157156
});
158157
} else {
159158
executeProcess(runCommand, (runResult) => {
160-
cleanup().finally(() => resolve(runResult));
159+
cleanup();
160+
resolve(runResult);
161161
});
162162
}
163163
});
164164
} else {
165165
executeProcess(runCommand, (runResult) => {
166-
cleanup().finally(() => resolve(runResult));
166+
cleanup();
167+
resolve(runResult);
167168
});
168169
}
169170
});

0 commit comments

Comments
 (0)