fix: container removal, no secretKey panic

This commit is contained in:
wancat committed 2023-11-01 23:09:39 +08:00
1 parent d4000eb5a6
commit c008f82cb0
4 files changed
+17 -11

No files matched your search

+8 -2
View File
@@ -15,7 +15,13 @@ export async function removeExpired() {
await Promise.all(
sessions.map(async (session) => {
console.log('Expiring session: ', session._id, session.containerId)
await deleteContainer(session.containerId)
try {
await deleteContainer(session.containerId)
} catch (err) {
if (err.statusCode !== 404) {
throw err
}
}
if (session.status === 'active') {
session.status = 'inactive'
}
@@ -25,7 +31,7 @@ export async function removeExpired() {
)
console.log('Done checking for expired sessions')
} catch (err) {
console.error(err.message)
console.error(err)
}
}