Merge pull request #7087 from Budibase/logs/invalidations

Adding logging for session invalidation
This commit is contained in:
Michael Drury 2022-08-04 16:09:45 +01:00 committed by GitHub
commit 881ad63a13
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
const redis = require("../redis/init")
const { v4: uuidv4 } = require("uuid")
const { logWarn } = require("../logging")
// a week in seconds
const EXPIRY_SECONDS = 86400 * 7
@ -38,6 +39,11 @@ async function invalidateSessions(userId, sessionIds = null) {
for (let session of sessions) {
promises.push(client.delete(session.key))
}
logWarn(
`Invalidating sessions for ${userId} - ${sessions
.map(session => session.key)
.join(", ")}`
)
await Promise.all(promises)
} catch (err) {
console.error(`Error invalidating sessions: ${err}`)

View File

@ -5,3 +5,4 @@ build/
docker-error.log
envoy.yaml
*.tar.gz
prebuilds/