Skip to content

Commit 4a8838d

Browse files
committed
db migration
1 parent 39a9a26 commit 4a8838d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/main.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { StationStats, type TableDataItem } from "../types.d.ts";
22
import { getWSData } from "./wind2speed.ts";
33
import { Application, Context, Router } from "@oak/oak";
44
import { oakCors } from "https://deno.land/x/[email protected]/mod.ts";
5-
import { stringify } from "jsr:@std/csv/stringify";
65

76
const kv = await Deno.openKv(Deno.env.get("KV_STORE") || undefined);
87

@@ -70,7 +69,9 @@ async function downloadWindData(stationId: number) {
7069
transaction.set(["station", data.station.id], {
7170
...data.station,
7271
totalEntries:
73-
(stationStats.value?.totalEntries ?? 0) + newTableData.length,
72+
(stationStats.value?.totalEntries ??
73+
(stationStats.value as any)?.entries ??
74+
0) + newTableData.length,
7475
latestEntryTimestamp: parseObsTimeLocal(
7576
newTableData[0].obsTimeLocal
7677
).getTime(),

0 commit comments

Comments
 (0)