Skip to content

Commit e6ff421

Browse files
committed
fetch without retry
1 parent ebc8659 commit e6ff421

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

svc/rater.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,30 @@ async function prefetchGcData() {
9898
const { rows } = await db.raw<{
9999
rows: { match_seq_num: number; match_id: number; pgroup: PGroup }[];
100100
}>(
101-
'SELECT match_seq_num, match_id, pgroup from rating_queue WHERE gcdata IS NULL ORDER BY match_seq_num LIMIT 10',
101+
'SELECT match_seq_num, match_id, pgroup from rating_queue WHERE gcdata IS NULL ORDER BY match_seq_num LIMIT 5',
102102
);
103103
if (rows.length) {
104104
// Attempt to fetch for each
105105
await Promise.all(rows.map(async (row) => {
106-
const { data } = await gcFetcher.getOrFetchDataWithRetry(row.match_id, {
106+
const { data } = await gcFetcher.getOrFetchData(row.match_id, {
107107
pgroup: row.pgroup,
108-
}, 500);
108+
});
109109
if (data) {
110110
// If successful, update
111111
await db.raw(
112112
'UPDATE rating_queue SET gcdata = ? WHERE match_seq_num = ?',
113113
[JSON.stringify(data), row.match_seq_num],
114114
);
115-
} else {
116-
// Match can't be rated due to lack of data
117-
await db.raw(
118-
'DELETE FROM rating_queue WHERE match_seq_num = ?',
119-
row.match_seq_num,
120-
);
121-
redisCount('rater_skip');
122115
}
116+
// If community prediction matches come back they can block the queue, might want a way of detecting them
117+
// } else {
118+
// // Match can't be rated due to lack of data
119+
// await db.raw(
120+
// 'DELETE FROM rating_queue WHERE match_seq_num = ?',
121+
// row.match_seq_num,
122+
// );
123+
// redisCount('rater_skip');
124+
// }
123125
}));
124126
}
125127
await new Promise((resolve) => setTimeout(resolve, 1000));

0 commit comments

Comments
 (0)