feat: remove container on finish

This commit is contained in:
Justin Lin committed 2025-05-09 16:46:13 +08:00
1 parent dca6861940
commit d9fc465731
1 file changed
+9
+9
View File
@@ -103,6 +103,15 @@ export async function finishSession(
progress.completed = true
}
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(