mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
fix mongo no matching document when deleting container
This commit is contained in:
1 parent
cfda174dc5
commit
79a5dac7f1
1 file changed
+3
-3
@@ -14,9 +14,9 @@ async function deactivateSessions(user, quest) {
|
||||
return deleteContainer(session.containerId)
|
||||
.catch((err) => logger.error('Failed to delete container', err))
|
||||
.finally(() => {
|
||||
session.status = 'inactive'
|
||||
session.containerId = null
|
||||
return session.save()
|
||||
return Session.findByIdAndUpdate(session._id, {
|
||||
$set: { status: 'inactive', containerId: null },
|
||||
}).catch((err) => logger.error('Failed to update session', err))
|
||||
})
|
||||
})
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user