1
0

feat: Announcement API
Remote Deploy / deploy (push) Successful in 2m38s

This commit is contained in:
2026-06-02 11:18:49 +02:00
parent 939633b675
commit abddc62f8c
5 changed files with 70 additions and 13 deletions
+6 -4
View File
@@ -1,4 +1,4 @@
import fs from "fs"
import fs from "fs/promises"
const CLASSES: string[] = [
"A1a", "A1b", "A1c", "C1a", "C1b", "C1c", "A2", "C2a", "C2b", "C2c", "E2", "C3a", "C3b", "C3c", "E3"
@@ -45,7 +45,7 @@ interface ScheduleData {
status: { lastUpdated: string };
}
export default function generateArchivedV1_V2(): void {
export default async function generateArchivedV1_V2() {
const dates = getCurrentWeekMondayToFriday();
const currentDate = new Date();
const lastUpdated = currentDate.getHours().toString().padStart(2, "0") + ":" + currentDate.getMinutes().toString().padStart(2, "0");
@@ -73,6 +73,8 @@ export default function generateArchivedV1_V2(): void {
data.schedule.push(d);
}
fs.writeFileSync("volume/db/v1.json", JSON.stringify(data, null, 2));
fs.writeFileSync("volume/db/v2.json", JSON.stringify(data, null, 2));
await Promise.all([
fs.writeFile("volume/db/v1.json", JSON.stringify(data, null, 2)),
fs.writeFile("volume/db/v2.json", JSON.stringify(data, null, 2)),
]);
}