add logs for neatqueue weird response breaking the sync

This commit is contained in:
2025-04-11 03:16:26 +02:00
parent b34342745f
commit d4f2342fa3

View File

@@ -46,10 +46,17 @@ export async function syncHistory() {
const firstGame = Object.keys(matches).sort( const firstGame = Object.keys(matches).sort(
(a, b) => Number.parseInt(a) - Number.parseInt(b) (a, b) => Number.parseInt(a) - Number.parseInt(b)
)[0] )[0]
if (!firstGame) { if (!firstGame) {
throw new Error('No first game found') throw new Error('No first game found')
} }
if (firstGame === 'detail') {
await db.insert(metadata).values({
key: 'history_cursor_failure',
value: JSON.stringify(matches),
})
throw new Error('Something went wrong')
}
await db await db
.insert(metadata) .insert(metadata)
.values({ .values({