mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30: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)
|
return deleteContainer(session.containerId)
|
||||||
.catch((err) => logger.error('Failed to delete container', err))
|
.catch((err) => logger.error('Failed to delete container', err))
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
session.status = 'inactive'
|
return Session.findByIdAndUpdate(session._id, {
|
||||||
session.containerId = null
|
$set: { status: 'inactive', containerId: null },
|
||||||
return session.save()
|
}).catch((err) => logger.error('Failed to update session', err))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user