From 0f646e634e5684b8c09df3dd2d24eaa9ad18d25e Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Wed, 9 Oct 2024 13:12:41 +0800 Subject: [PATCH] wip --- server/database.js | 7 +++---- server/uptime-calculator.js | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/database.js b/server/database.js index c8a33ac20..ea0db663c 100644 --- a/server/database.js +++ b/server/database.js @@ -776,9 +776,6 @@ class Database { ORDER BY monitor_id ASC `); - console.log("Dates", dates); - console.log("Monitors", monitors); - // Stop if stat_* tables are not empty for (let table of [ "stat_minutely", "stat_hourly", "stat_daily" ]) { let countResult = await R.getRow(`SELECT COUNT(*) AS count FROM ${table}`); @@ -790,6 +787,8 @@ class Database { } for (let monitor of monitors) { + + // TODO: Get the date list for each monitor for (let date of dates) { // New Uptime Calculator @@ -816,7 +815,7 @@ class Database { } } - //await Settings.set("migratedAggregateTable", true); + await Settings.set("migratedAggregateTable", true); } } diff --git a/server/uptime-calculator.js b/server/uptime-calculator.js index ea2118b51..43f6b5a56 100644 --- a/server/uptime-calculator.js +++ b/server/uptime-calculator.js @@ -339,6 +339,7 @@ class UptimeCalculator { } await R.store(minutelyStatBean); + // TODO: it seems that it is also necessary to remove the old data in the migration mode if (!this.migrationMode) { // Remove the old data log.debug("uptime-calc", "Remove old data");