From 48a9a4dd0e31f84209635382be4ec4bb2c3a9c0c Mon Sep 17 00:00:00 2001 From: Yury Date: Thu, 31 Oct 2024 11:17:20 +0300 Subject: [PATCH] fix(api): fixed condition in processProgram --- api/src/controllers/internal/processProgram.ts | 2 +- api/src/types/Session.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/controllers/internal/processProgram.ts b/api/src/controllers/internal/processProgram.ts index 791a3a9..0557c0f 100644 --- a/api/src/controllers/internal/processProgram.ts +++ b/api/src/controllers/internal/processProgram.ts @@ -49,7 +49,7 @@ export const processProgram = async ( await moveFile(codePath + '.bkp', codePath) // we now need to poll the session status - while (session.state === SessionState.completed) { + while (session.state !== SessionState.completed) { await delay(50) } } else { diff --git a/api/src/types/Session.ts b/api/src/types/Session.ts index 1015e1e..31399e4 100644 --- a/api/src/types/Session.ts +++ b/api/src/types/Session.ts @@ -1,5 +1,5 @@ export enum SessionState { - initialising = 'initialising', // session is initialising and nor ready to be used yet + initialising = 'initialising', // session is initialising and not ready to be used yet pending = 'pending', // session is ready to be used running = 'running', // session is in use completed = 'completed', // session is completed and can be destroyed