From 2b5318e7a6179bdb685991f639fd17d86f9f8d4c Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 21 Sep 2023 17:08:57 -0400 Subject: [PATCH] Log any database errors when fetching stats Previously, these errors were simply ignored --- nodeinfo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodeinfo.go b/nodeinfo.go index 571a441..6ce3572 100644 --- a/nodeinfo.go +++ b/nodeinfo.go @@ -94,6 +94,9 @@ INNER JOIN collections c ON collection_id = c.id WHERE collection_id IS NOT NULL AND updated > DATE_SUB(NOW(), INTERVAL 6 MONTH)) co`).Scan(&activeHalfYear) + if err != nil { + log.Error("Failed getting 6-month active user stats: %s", err) + } err = r.db.QueryRow(`SELECT COUNT(*) FROM ( SELECT DISTINCT collection_id @@ -102,6 +105,9 @@ INNER JOIN collections c ON collection_id = c.id WHERE collection_id IS NOT NULL AND updated > DATE_SUB(NOW(), INTERVAL 1 MONTH)) co`).Scan(&activeMonth) + if err != nil { + log.Error("Failed getting 1-month active user stats: %s", err) + } } return nodeinfo.Usage{