Skip to content

Commit

Permalink
delete invalid matches
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Feb 25, 2024
1 parent 27dea50 commit 2a9c735
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev/fixProMatches.mts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isProMatch } from '../util/utility.js';

const { insertMatch } = await import('../store/insert.js');
const { db } = await import('../store/db.js');
const { generateJob, getSteamAPIData } = await import('../util/utility.js');
Expand All @@ -16,7 +18,7 @@ for (let i = 0; i < rows.length; i++) {
});
if (body.result) {
const match = body.result;
if (match.radiant_score === 0 && match.dire_score === 0) {
if (!isProMatch(match)) {
await db.raw('DELETE FROM matches WHERE match_id = ?', [match.match_id]);
} else {
await insertMatch(match, { type: 'api' });
Expand Down

0 comments on commit 2a9c735

Please sign in to comment.