mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: add session expiry deletion script and scheduler
This commit is contained in:
1 parent
8e63284211
commit
22060070b9
8 files changed
+94
-3
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user