Skip to content

Commit

Permalink
io
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 committed Jul 22, 2024
1 parent 242c965 commit bc02a83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/src/instance/instance-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>('Application').updateOne(
{ appid: app.appid, phase: ApplicationPhase.Starting },
{ appid: app.appid },
{
$set: {
state: ApplicationState.Stopped,
Expand All @@ -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`)
Expand Down

0 comments on commit bc02a83

Please sign in to comment.