From efdffca06ccf4a8ca96a2ffce44467386c3fb852 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 12 Dec 2024 14:49:01 +0800 Subject: [PATCH] Fix: [MariaDB] Unable to clean up heartbeat data (#5425) Co-authored-by: GJS Co-authored-by: Frank Elsinga --- package-lock.json | 4 ++-- server/database.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 100cdcd8..328b1d28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "2.0.0-dev", + "version": "2.0.0-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "2.0.0-dev", + "version": "2.0.0-beta.0", "license": "MIT", "dependencies": { "@grpc/grpc-js": "~1.8.22", diff --git a/server/database.js b/server/database.js index 3b7646de..0e6a7405 100644 --- a/server/database.js +++ b/server/database.js @@ -892,11 +892,13 @@ class Database { AND important = 0 AND time < ${sqlHourOffset} AND id NOT IN ( - SELECT id - FROM heartbeat - WHERE monitor_id = ? - ORDER BY time DESC - LIMIT ? + SELECT id FROM ( -- written this way for Maria's support + SELECT id + FROM heartbeat + WHERE monitor_id = ? + ORDER BY time DESC + LIMIT ? + ) AS limited_ids ) `, [ monitor.id,