Skip to content

Commit

Permalink
db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescorpian committed Mar 4, 2025
1 parent 39a9a26 commit 4a8838d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { StationStats, type TableDataItem } from "../types.d.ts";
import { getWSData } from "./wind2speed.ts";
import { Application, Context, Router } from "@oak/oak";
import { oakCors } from "https://deno.land/x/[email protected]/mod.ts";
import { stringify } from "jsr:@std/csv/stringify";

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

Expand Down Expand Up @@ -70,7 +69,9 @@ async function downloadWindData(stationId: number) {
transaction.set(["station", data.station.id], {
...data.station,
totalEntries:
(stationStats.value?.totalEntries ?? 0) + newTableData.length,
(stationStats.value?.totalEntries ??
(stationStats.value as any)?.entries ??
0) + newTableData.length,
latestEntryTimestamp: parseObsTimeLocal(
newTableData[0].obsTimeLocal
).getTime(),
Expand Down

0 comments on commit 4a8838d

Please sign in to comment.