From 3032dbcc96e357e3a27a60978e404450dac660c7 Mon Sep 17 00:00:00 2001 From: Giuseppe Raffa <77052701+sesee3@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:54:25 +0200 Subject: [PATCH] feat: enhance InfluxDB health check logging with detailed error information --- api/src/storage/influx.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/api/src/storage/influx.js b/api/src/storage/influx.js index 04aadcf..c369917 100644 --- a/api/src/storage/influx.js +++ b/api/src/storage/influx.js @@ -62,10 +62,18 @@ async function query(bucket, relativeTime, measurement, sensor, field) { async function checkInflux() { try { - await querying.rows(`from(bucket: "boat") |> range(start: -1s) |> limit(n:1)`).next(); - return true; + const result = await querying.collectRows( + `from(bucket: "boat") |> range(start: -1s) |> limit(n:1)` + ); + console.log('InfluxDB: OK'); + return { ok: true }; } catch (error) { - return false; + console.error('InfluxDB check failed:', { + message: error.message, + statusCode: error.statusCode ?? 'N/A', + body: error.body ?? 'N/A' + }); + return false } }