Skip to content

Commit

Permalink
fix: gsi cache wasn't clearing lol what a silly mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Oct 7, 2023
1 parent d55f65e commit 9738b00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dota/src/dota/GSIServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Server, Socket } from 'socket.io'

import getDBUser from '../db/getDBUser.js'
import { logger } from '../utils/logger.js'
import { checkForInactiveTokens, tokenLastPostTimestamps } from './clearCacheForUser.js'
import { newData, processChanges } from './globalEventEmitter.js'
import { emitMinimapBlockerStatus } from './GSIHandler.js'
import { gsiHandlers } from './lib/consts.js'
import { validateToken } from './validateToken.js'
import { checkForInactiveTokens, tokenLastPostTimestamps } from './clearCacheForUser.js'

function handleSocketAuth(socket: Socket, next: (err?: Error) => void) {
const { token } = socket.handshake.auth
Expand Down Expand Up @@ -63,7 +63,6 @@ class GSIServer {
app.use(express.json({ limit: '1mb' }))
app.use(express.urlencoded({ extended: true, limit: '1mb' }))

app.post('/', validateToken, processChanges('previously'), processChanges('added'), newData)
app.post(
'/',
validateToken,
Expand Down Expand Up @@ -92,6 +91,7 @@ class GSIServer {
this.io.on('connection', handleSocketConnection)

// Set up the repeating timer
// eslint-disable-next-line @typescript-eslint/no-misused-promises
setInterval(checkForInactiveTokens, 60 * 1000) // Run every minute
}

Expand Down

0 comments on commit 9738b00

Please sign in to comment.