first reading the start of a map with a 3 minute delay to overcome the transition period from the previous map
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { query } from '@/lib/db';
|
||||
import { START_BASELINE_MIN } from '@/lib/populationBaseline';
|
||||
|
||||
// map_end_dt was dropped from the schema — it was redundant with (and
|
||||
// occasionally got out of sync with) the next row's map_start_dt, since a
|
||||
@@ -123,8 +124,8 @@ export async function getMapPopulationSeries(limit = 40, before?: string): Promi
|
||||
AND (s.session_end_dt IS NULL OR s.session_end_dt > m.map_start_dt)
|
||||
) AS total_players,
|
||||
(SELECT COUNT(DISTINCT s.steamid) FROM playtime_display_sessions s
|
||||
WHERE s.session_start_dt <= m.map_start_dt
|
||||
AND (s.session_end_dt IS NULL OR s.session_end_dt > m.map_start_dt)
|
||||
WHERE s.session_start_dt <= LEAST(m.map_start_dt + INTERVAL ${START_BASELINE_MIN} MINUTE, COALESCE(${NEXT_MAP_START('m')}, NOW()))
|
||||
AND (s.session_end_dt IS NULL OR s.session_end_dt > LEAST(m.map_start_dt + INTERVAL ${START_BASELINE_MIN} MINUTE, COALESCE(${NEXT_MAP_START('m')}, NOW())))
|
||||
) AS start_players,
|
||||
(SELECT COUNT(DISTINCT s.steamid) FROM playtime_display_sessions s
|
||||
WHERE s.session_start_dt <= COALESCE(${NEXT_MAP_START('m')}, NOW())
|
||||
|
||||
Reference in New Issue
Block a user