From 3c24470419ea105db980a6f7b7d76f25bcf45c4f Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 9 Nov 2025 22:55:19 +0000
Subject: [PATCH 1/3] Initial plan
From 0be3d35d44d544bdabb6e7c8e8d787cf87f6c8e7 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 9 Nov 2025 23:04:33 +0000
Subject: [PATCH 2/3] Remove dead code: commented-out telemetry emits and
unused constants
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
---
backend/scheduler/jobs/daily.currencyupdate.ts | 2 --
backend/scheduler/jobs/daily.outageupdate.ts | 2 --
backend/scheduler/jobs/daily.priceupdate.ts | 2 --
backend/scheduler/jobs/hourly.consumptionupdate.ts | 7 -------
backend/scheduler/jobs/hourly.productionupdate.ts | 4 ----
utils/log.ts | 7 +------
6 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/backend/scheduler/jobs/daily.currencyupdate.ts b/backend/scheduler/jobs/daily.currencyupdate.ts
index 9a3b0fd..db47c3b 100644
--- a/backend/scheduler/jobs/daily.currencyupdate.ts
+++ b/backend/scheduler/jobs/daily.currencyupdate.ts
@@ -40,8 +40,6 @@ const DailyCurrencyUpdate = async () => {
log("info", `Scheduled data update done`);
tm.emit("spotweb-main", "clear_cache", { cache: "exrate" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "exrate" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "exrate" });
database.close();
diff --git a/backend/scheduler/jobs/daily.outageupdate.ts b/backend/scheduler/jobs/daily.outageupdate.ts
index 8328f1b..6d99bc5 100644
--- a/backend/scheduler/jobs/daily.outageupdate.ts
+++ b/backend/scheduler/jobs/daily.outageupdate.ts
@@ -98,8 +98,6 @@ const DailyOutageUpdate = async () => {
log("info", `Scheduled data update done`);
tm.emit("spotweb-main", "clear_cache", { cache: "outage" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "outage" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "outage" });
database.close();
diff --git a/backend/scheduler/jobs/daily.priceupdate.ts b/backend/scheduler/jobs/daily.priceupdate.ts
index 4eccd5b..47f9e85 100644
--- a/backend/scheduler/jobs/daily.priceupdate.ts
+++ b/backend/scheduler/jobs/daily.priceupdate.ts
@@ -119,8 +119,6 @@ const DailyPriceUpdate = async () => {
log("info", `Scheduled data update done`);
tm.emit("spotweb-main", "clear_cache", { cache: "spotprices" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "spotprices" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "spotprices" });
database.close();
diff --git a/backend/scheduler/jobs/hourly.consumptionupdate.ts b/backend/scheduler/jobs/hourly.consumptionupdate.ts
index 9335960..ff84646 100644
--- a/backend/scheduler/jobs/hourly.consumptionupdate.ts
+++ b/backend/scheduler/jobs/hourly.consumptionupdate.ts
@@ -75,17 +75,10 @@ const HourlyConsumptionUpdate = async () => {
log("error", `Error occured while updating data, skipping. Error: ${e}`);
}
- // Clear memory cache
- log("info", `Database changed, clearing cache, realm load.`);
-
log("info", `Scheduled data update done`);
tm.emit("spotweb-main", "clear_cache", { cache: "load" });
tm.emit("spotweb-main", "clear_cache", { cache: "generation" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "load" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "generation" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "load" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "generation" });
database.close();
diff --git a/backend/scheduler/jobs/hourly.productionupdate.ts b/backend/scheduler/jobs/hourly.productionupdate.ts
index e3d6116..741d3f5 100644
--- a/backend/scheduler/jobs/hourly.productionupdate.ts
+++ b/backend/scheduler/jobs/hourly.productionupdate.ts
@@ -120,10 +120,6 @@ const HourlyProductionUpdate = async () => {
tm.emit("spotweb-main", "clear_cache", { cache: "load" });
tm.emit("spotweb-main", "clear_cache", { cache: "generation" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "load" });
- //tm.emit("spotweb-main-2", "clear_cache", { cache: "generation" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "load" });
- //tm.emit("spotweb-main-3", "clear_cache", { cache: "generation" });
database.close();
diff --git a/utils/log.ts b/utils/log.ts
index c0e3eea..c512b99 100644
--- a/utils/log.ts
+++ b/utils/log.ts
@@ -1,5 +1,4 @@
let level = "normal";
-const decorate = false;
const setLevel = (requestedLevel: string) => {
level = requestedLevel;
@@ -14,11 +13,7 @@ const log = (type: string, t: string) => {
else if (type === "debug") fn = console.debug;
else throw new Error("Invalid log type, cannot log: " + t);
if (fn) {
- if (decorate) {
- fn(new Date().toLocaleString("sv-SE"), "Backend:", t);
- } else {
- fn(t);
- }
+ fn(t);
}
};
From 0b003f17ce29f9c24c430863c89e174ea2517b4a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 9 Nov 2025 23:17:24 +0000
Subject: [PATCH 3/3] Fix code formatting per precommit checks
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
---
backend/db/index.ts | 8 ++---
backend/db/sql/index.ts | 8 ++---
deno.json | 2 +-
static/BingSiteAuth.xml | 4 +--
static/css/custom.css | 78 ++++++++++++++++++++---------------------
static/offline.html | 14 ++++----
utils/common.ts | 29 +++++++++------
utils/price.ts | 12 +++----
8 files changed, 81 insertions(+), 74 deletions(-)
diff --git a/backend/db/index.ts b/backend/db/index.ts
index 1f69bfd..458b13a 100644
--- a/backend/db/index.ts
+++ b/backend/db/index.ts
@@ -14,16 +14,16 @@ import {
sqlExchangeRates,
sqlFutureOutagesPerArea,
sqlGeneration,
+ sqlGenerationAnyInterval,
sqlGroupBy,
+ sqlLatestGenerationInterval,
+ sqlLatestLoadInterval,
sqlLatestPricePerArea,
sqlLatestPricePerCountry,
- sqlLatestLoadInterval,
- sqlLatestGenerationInterval,
sqlLoad,
- sqlLoadAnyInterval,
sqlLoadAndGeneration,
+ sqlLoadAnyInterval,
sqlRaw,
- sqlGenerationAnyInterval,
} from "backend/db/sql/index.ts";
import { DataCache } from "utils/datacache.ts";
import { log } from "utils/log.ts";
diff --git a/backend/db/sql/index.ts b/backend/db/sql/index.ts
index e9fae21..660d59d 100644
--- a/backend/db/sql/index.ts
+++ b/backend/db/sql/index.ts
@@ -438,14 +438,14 @@ export {
sqlExchangeRates,
sqlFutureOutagesPerArea,
sqlGeneration,
+ sqlGenerationAnyInterval,
sqlGroupBy,
+ sqlLatestGenerationInterval,
+ sqlLatestLoadInterval,
sqlLatestPricePerArea,
sqlLatestPricePerCountry,
- sqlLatestLoadInterval,
- sqlLatestGenerationInterval,
sqlLoad,
- sqlLoadAnyInterval,
sqlLoadAndGeneration,
+ sqlLoadAnyInterval,
sqlRaw,
- sqlGenerationAnyInterval,
};
diff --git a/deno.json b/deno.json
index c255564..a339230 100644
--- a/deno.json
+++ b/deno.json
@@ -26,7 +26,7 @@
"croner": "jsr:@hexagon/croner@^9.1.0",
"entsoe_api_client": "https://deno.land/x/entsoe_api_client@1.0.3/mod.ts",
"fresh_seo": "https://deno.land/x/fresh_seo@1.0.1/mod.ts",
- "https://deno.land/x/glob_filter@1.0.0/mod.ts": "https://deno.land/x/glob_filter@1.0.1/mod.ts",
+ "https://deno.land/x/glob_filter@1.0.0/mod.ts": "https://deno.land/x/glob_filter@1.0.1/mod.ts",
"islands/": "./islands/",
"localekit_fresh": "https://deno.land/x/localekit_fresh@0.5.2/mod.ts",
"preact": "https://esm.sh/preact@10.19.6",
diff --git a/static/BingSiteAuth.xml b/static/BingSiteAuth.xml
index e095dd9..0d6d158 100644
--- a/static/BingSiteAuth.xml
+++ b/static/BingSiteAuth.xml
@@ -1,4 +1,4 @@