From bc02a83fb58c2120e6f51316d7daab35145e1d4d Mon Sep 17 00:00:00 2001 From: HUAHUAI23 Date: Mon, 22 Jul 2024 14:10:38 +0000 Subject: [PATCH] io --- server/src/instance/instance-task.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/instance/instance-task.service.ts b/server/src/instance/instance-task.service.ts index d8711f2..2e0212d 100644 --- a/server/src/instance/instance-task.service.ts +++ b/server/src/instance/instance-task.service.ts @@ -114,7 +114,7 @@ export class InstanceTaskService { // if waiting time is more than 10 minutes, stop the application if (waitingTime > 1000 * 60 * 10) { await db.collection('Application').updateOne( - { appid: app.appid, phase: ApplicationPhase.Starting }, + { appid: app.appid }, { $set: { state: ApplicationState.Stopped, @@ -134,7 +134,12 @@ export class InstanceTaskService { state: DedicatedDatabaseState.Running, phase: DedicatedDatabasePhase.Started, }, - { $set: { state: DedicatedDatabaseState.Stopped } }, + { + $set: { + state: DedicatedDatabaseState.Stopped, + phase: DedicatedDatabasePhase.Stopping, + }, + }, ) this.logger.log(`${app.appid} updated to state Stopped due to timeout`)