Don't let an external websocket close cause a cleanup
This commit is contained in:
parent
993d5c6fb0
commit
91789b9e32
|
@ -219,6 +219,7 @@ router.ws('/connect', async (ws, req) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
await job.execute_interactive(eventBus);
|
await job.execute_interactive(eventBus);
|
||||||
|
await job.cleanup();
|
||||||
|
|
||||||
ws.close(4999, 'Job Completed');
|
ws.close(4999, 'Job Completed');
|
||||||
} else {
|
} else {
|
||||||
|
@ -255,12 +256,6 @@ router.ws('/connect', async (ws, req) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ws.on('close', async () => {
|
|
||||||
if (job !== null) {
|
|
||||||
await job.cleanup();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
//Terminate the socket after 1 second, if not initialized.
|
//Terminate the socket after 1 second, if not initialized.
|
||||||
if (job === null) ws.close(4001, 'Initialization Timeout');
|
if (job === null) ws.close(4001, 'Initialization Timeout');
|
||||||
|
|
Loading…
Reference in New Issue