mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
fix: update config field name
This commit is contained in:
1 parent
d745531a14
commit
59ced31094
1 file changed
+5
-1
@@ -6,10 +6,11 @@ import { deleteContainer } from './docker.js'
|
|||||||
export async function removeExpired() {
|
export async function removeExpired() {
|
||||||
// Find all sessions that are containerId is not null and lastActivityAt is
|
// Find all sessions that are containerId is not null and lastActivityAt is
|
||||||
// less than the current time minus the expiry time
|
// less than the current time minus the expiry time
|
||||||
|
try {
|
||||||
console.log('Checking for expired sessions')
|
console.log('Checking for expired sessions')
|
||||||
const sessions = await Session.find({
|
const sessions = await Session.find({
|
||||||
containerId: { $ne: null },
|
containerId: { $ne: null },
|
||||||
lastActivityAt: { $lt: new Date(Date.now() - config.expiry) },
|
lastActivityAt: { $lt: new Date(Date.now() - config.containerExpiry) },
|
||||||
})
|
})
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
sessions.map(async (session) => {
|
sessions.map(async (session) => {
|
||||||
@@ -21,6 +22,9 @@ export async function removeExpired() {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
console.log('Done checking for expired sessions')
|
console.log('Done checking for expired sessions')
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function expiryRemovalScheduler() {
|
export default function expiryRemovalScheduler() {
|
||||||
|
|||||||
Reference in new issue
Block a user