TaskRunProcessProvider cleanup is async
This commit is contained in:
@@ -417,7 +417,7 @@ export class ManagedRunController {
|
||||
});
|
||||
|
||||
this.currentExecution?.kill().catch(() => {});
|
||||
this.taskRunProcessProvider.cleanup();
|
||||
this.taskRunProcessProvider.cleanup().catch(() => {});
|
||||
|
||||
process.exit(code);
|
||||
}
|
||||
@@ -558,7 +558,15 @@ export class ManagedRunController {
|
||||
}
|
||||
|
||||
// Cleanup the task run process provider
|
||||
this.taskRunProcessProvider.cleanup();
|
||||
const [cleanupError] = await tryCatch(this.taskRunProcessProvider.cleanup());
|
||||
|
||||
if (cleanupError) {
|
||||
this.sendDebugLog({
|
||||
runId: this.runFriendlyId,
|
||||
message: "Error during task run process provider cleanup",
|
||||
properties: { error: String(cleanupError) },
|
||||
});
|
||||
}
|
||||
|
||||
// Close the socket
|
||||
this.socket.close();
|
||||
|
||||
@@ -162,11 +162,11 @@ export class TaskRunProcessProvider {
|
||||
/**
|
||||
* Forces cleanup of any persistent process
|
||||
*/
|
||||
cleanup(): void {
|
||||
async cleanup() {
|
||||
if (this.persistentProcess) {
|
||||
this.sendDebugLog("cleanup() called");
|
||||
|
||||
this.cleanupProcess(this.persistentProcess);
|
||||
await this.cleanupProcess(this.persistentProcess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user