feat: add session expiry deletion script and scheduler

This commit is contained in:
wancat committed 2023-08-23 12:22:15 +08:00
1 parent 8e63284211
commit 22060070b9
8 files changed
+94 -3

No files matched your search

+15
View File
@@ -65,3 +65,18 @@ export async function attachContainer(container, { token }) {
return execOutput.socket
}
export async function deleteContainer(id) {
const container = engine.getContainer(id)
if (!container) {
return
}
try {
await container.stop()
await container.remove({
force: true,
})
} catch (error) {
console.log(error)
}
}