mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: remove container on finish
This commit is contained in:
1 parent
dca6861940
commit
d9fc465731
1 file changed
+9
@@ -103,6 +103,15 @@ export async function finishSession(
|
|||||||
progress.completed = true
|
progress.completed = true
|
||||||
}
|
}
|
||||||
await userProfile.save()
|
await userProfile.save()
|
||||||
|
if (session.containerId) {
|
||||||
|
deleteContainer(session.containerId)
|
||||||
|
.catch((err) => logger.error('Failed to delete container', err))
|
||||||
|
.finally(() => {
|
||||||
|
return Session.findByIdAndUpdate(session._id, {
|
||||||
|
$set: { containerId: null },
|
||||||
|
}).catch((err) => logger.error('Failed to update session', err))
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function isQuestUnlocked(
|
export async function isQuestUnlocked(
|
||||||
|
|||||||
Reference in new issue
Block a user