chore: add prettier with config and format all files
This commit is contained in:
@@ -5,10 +5,7 @@ import type { SessionBoundary } from '@/lib/types';
|
||||
* Returns session-start timestamps where any gap > 30 min exists
|
||||
* in the global tick_timing timeline.
|
||||
*/
|
||||
export async function getSessionBoundaries(
|
||||
from: Date,
|
||||
to: Date,
|
||||
): Promise<SessionBoundary[]> {
|
||||
export async function getSessionBoundaries(from: Date, to: Date): Promise<SessionBoundary[]> {
|
||||
const result = await pool.query<{ real_time: Date; game_tick: string }>(
|
||||
`SELECT real_time, game_tick
|
||||
FROM tick_timing
|
||||
@@ -20,10 +17,12 @@ export async function getSessionBoundaries(
|
||||
const rows = result.rows;
|
||||
if (rows.length === 0) return [];
|
||||
|
||||
const boundaries: SessionBoundary[] = [{
|
||||
real_time: rows[0].real_time.toISOString(),
|
||||
game_tick: parseInt(rows[0].game_tick, 10),
|
||||
}];
|
||||
const boundaries: SessionBoundary[] = [
|
||||
{
|
||||
real_time: rows[0].real_time.toISOString(),
|
||||
game_tick: parseInt(rows[0].game_tick, 10),
|
||||
},
|
||||
];
|
||||
|
||||
for (let i = 1; i < rows.length; i++) {
|
||||
if (rows[i].real_time.getTime() - rows[i - 1].real_time.getTime() > 30 * 60 * 1000) {
|
||||
@@ -35,4 +34,4 @@ export async function getSessionBoundaries(
|
||||
}
|
||||
|
||||
return boundaries;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user