fix: update SQL query to use server time for session expiration checks
This commit is contained in:
@@ -93,15 +93,15 @@ async function evaluateQueue(eventId, io) {
|
|||||||
try {
|
try {
|
||||||
// Debug: check current time vs stored times
|
// Debug: check current time vs stored times
|
||||||
const [allSessions] = await connection.execute(
|
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]
|
[eventId]
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log(`Event ${eventId} - Current sessions:`, allSessions.map(s => ({
|
console.log(`Event ${eventId} - Current sessions:`, allSessions.map(s => ({
|
||||||
socket: s.socket_id.substring(0, 8),
|
socket: s.socket_id.substring(0, 8),
|
||||||
expires: s.expires_at,
|
expires: s.expires_at,
|
||||||
current: s.current_time,
|
server_time: s.server_time,
|
||||||
expired: new Date(s.expires_at) < new Date(s.current_time)
|
expired: new Date(s.expires_at) < new Date(s.server_time)
|
||||||
})))
|
})))
|
||||||
|
|
||||||
const [expiredSessions] = await connection.execute(
|
const [expiredSessions] = await connection.execute(
|
||||||
|
|||||||
Reference in New Issue
Block a user