Skip to content

Commit

Permalink
Purge compute job on interactive session close. Closes #1924 (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Sep 28, 2020
1 parent bdd44f9 commit 370b303
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routers/InteractiveCompute/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ class Session extends EventEmitter {
const name = 'DeepForge Interactive Session';
const computeJob = new ComputeJob(hash, name);
this.jobInfo = this.compute.startJob(computeJob);
this.compute.on('end', (id, info) => {
this.compute.on('end', async (id, info) => {
const isError = this.clientSocket.readyState === WebSocket.OPEN &&
info.status !== ComputeClient.SUCCESS;
if (isError) {
this.clientSocket.send(Message.encode(Message.ERROR, info));
}
await this.compute.purgeJob(computeJob);
});
}

Expand Down

0 comments on commit 370b303

Please sign in to comment.