Skip to content

Commit ffa9998

Browse files
committed
add seqnumseed
1 parent d289a1a commit ffa9998

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

dev/seqNumBackfill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { apiFetcher } from "../svc/fetcher/allFetchers.ts";
22

3-
await apiFetcher.getOrFetchData(8814800807, { seqNumBackfill: true });
3+
await apiFetcher.getOrFetchData(8814800807, { seqNumBackfill: true, seqNumSeed: 7408182833 });

global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ type Metric = {
523523

524524
type ApiExtraData = {
525525
seqNumBackfill?: boolean;
526+
seqNumSeed?: number;
526527
};
527528

528529
type GcExtraData = {

svc/fetcher/ApiFetcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ApiFetcher extends MatchFetcherBase<ApiData> {
3232
// });
3333
// match = body.result;
3434
if (options?.seqNumBackfill) {
35-
match = await this.backfillFromSeqNumApi_INTERNAL(matchId);
35+
match = await this.backfillFromSeqNumApi_INTERNAL(matchId, options?.seqNumSeed);
3636
}
3737
} catch (e: any) {
3838
if (e?.result?.error === "Match ID not found") {
@@ -58,7 +58,7 @@ export class ApiFetcher extends MatchFetcherBase<ApiData> {
5858
error: "[APIDATA]: Could not get API data for match " + matchId,
5959
};
6060
};
61-
backfillFromSeqNumApi_INTERNAL = async (matchId: number) => {
61+
backfillFromSeqNumApi_INTERNAL = async (matchId: number, seqNumSeed?: number) => {
6262
// Try to get match data from blob store
6363
// If not available, go back 1 ID number and try again until success (or 0)
6464
// count how many times we do this (max 100)
@@ -74,7 +74,7 @@ export class ApiFetcher extends MatchFetcherBase<ApiData> {
7474
redisCount("backfill_skip");
7575
return;
7676
}
77-
let earlierSeqNum;
77+
let earlierSeqNum = seqNumSeed;
7878
let pageBack = 0;
7979
while (!earlierSeqNum && pageBack <= 1000) {
8080
console.log("looking back %s for matchId %s", pageBack, matchId);

0 commit comments

Comments
 (0)