fix: update SQL query to use server time for session expiration checks

This commit is contained in:
2025-09-19 19:53:31 +02:00
parent 0f913ee940
commit 05fc2496d7

View File

@@ -93,15 +93,15 @@ async function evaluateQueue(eventId, io) {
try {
// Debug: check current time vs stored times
const [allSessions] = await connection.execute(
'SELECT socket_id, expires_at, NOW() as current_time FROM active_sessions WHERE event_id = ?',
'SELECT socket_id, expires_at, NOW() as server_time FROM active_sessions WHERE event_id = ?',
[eventId]
)
console.log(`Event ${eventId} - Current sessions:`, allSessions.map(s => ({
socket: s.socket_id.substring(0, 8),
expires: s.expires_at,
current: s.current_time,
expired: new Date(s.expires_at) < new Date(s.current_time)
server_time: s.server_time,
expired: new Date(s.expires_at) < new Date(s.server_time)
})))
const [expiredSessions] = await connection.execute(