Skip to content

Commit 4276314

Browse files
committed
fix
1 parent 111af48 commit 4276314

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

scripts/sync-sched/sync.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import assert from "node:assert"
44
import { parseArgs } from "node:util"
5-
import { readFileSync, existsSync } from "node:fs"
65
import { join } from "node:path"
76

87
import {
@@ -11,14 +10,16 @@ import {
1110
getSpeakers,
1211
RequestContext,
1312
} from "@/app/conf/_api/sched-client"
14-
import { SchedSpeaker, ScheduleSession } from "@/app/conf/_api/sched-types"
13+
import type { SchedSpeaker } from "@/app/conf/_api/sched-types"
1514
import { readFile, writeFile } from "node:fs/promises"
1615

17-
// Sched API rate limit is 30 requests per minute per token.
18-
// This scripts fires:
19-
// - one request for the entire schedule which overwritten
20-
// - one request for the list of speakers with partial details
21-
// - and N requests for the full details of each speaker
16+
/**
17+
* Sched API rate limit is 30 requests per minute per token.
18+
* This scripts fires:
19+
* - one request for the entire schedule which overwritten
20+
* - one request for the list of speakers with partial details
21+
* - and N requests for the full details of each speaker
22+
*/
2223
const SPEAKER_DETAILS_REQUEST_QUOTA = 10
2324

2425
const options = {
@@ -88,7 +89,7 @@ async function sync(year: number, token: string) {
8889
const existingSpeakers = readFile(speakersFilePath, "utf-8").then(JSON.parse)
8990

9091
const scheduleComparison = compare(
91-
await existingSpeakers,
92+
await existingSchedule,
9293
await schedule,
9394
"id",
9495
{ merge: false },

0 commit comments

Comments
 (0)