Interactive execution: run job cleanup regardless of errors
This commit is contained in:
parent
fe2fc374aa
commit
040e19fdc2
|
@ -210,6 +210,7 @@ router.ws('/connect', async (ws, req) => {
|
|||
if (job === null) {
|
||||
job = await get_job(msg);
|
||||
|
||||
try {
|
||||
await job.prime();
|
||||
|
||||
ws.send(
|
||||
|
@ -221,8 +222,14 @@ router.ws('/connect', async (ws, req) => {
|
|||
);
|
||||
|
||||
await job.execute(event_bus);
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Error cleaning up job: ${job.uuid}:\n${error}`
|
||||
);
|
||||
throw error;
|
||||
} finally {
|
||||
await job.cleanup();
|
||||
|
||||
}
|
||||
ws.close(4999, 'Job Completed');
|
||||
} else {
|
||||
ws.close(4000, 'Already Initialized');
|
||||
|
|
Loading…
Reference in New Issue