2
2
3
3
import assert from "node:assert"
4
4
import { parseArgs } from "node:util"
5
- import { readFileSync , existsSync } from "node:fs"
6
5
import { join } from "node:path"
7
6
8
7
import {
@@ -11,14 +10,16 @@ import {
11
10
getSpeakers ,
12
11
RequestContext ,
13
12
} 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"
15
14
import { readFile , writeFile } from "node:fs/promises"
16
15
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
+ */
22
23
const SPEAKER_DETAILS_REQUEST_QUOTA = 10
23
24
24
25
const options = {
@@ -88,7 +89,7 @@ async function sync(year: number, token: string) {
88
89
const existingSpeakers = readFile ( speakersFilePath , "utf-8" ) . then ( JSON . parse )
89
90
90
91
const scheduleComparison = compare (
91
- await existingSpeakers ,
92
+ await existingSchedule ,
92
93
await schedule ,
93
94
"id" ,
94
95
{ merge : false } ,
0 commit comments