From 8d61f6310cf3c05227c0f143bd43c38f7befa636 Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Fri, 13 Dec 2024 19:52:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=87=20back:=20silent=20output=20of=20p?= =?UTF-8?q?urposefully=20non=20implemented=20diagnostics=20(#762)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node/src/core/platform/framework/api/diagnostics.ts | 6 ++++-- .../database/services/orm/connectors/postgres/postgres.ts | 2 +- .../platform/services/storage/connectors/S3/s3-service.ts | 3 ++- .../platform/services/storage/connectors/local/service.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tdrive/backend/node/src/core/platform/framework/api/diagnostics.ts b/tdrive/backend/node/src/core/platform/framework/api/diagnostics.ts index 2ff87703..09b2aaa8 100644 --- a/tdrive/backend/node/src/core/platform/framework/api/diagnostics.ts +++ b/tdrive/backend/node/src/core/platform/framework/api/diagnostics.ts @@ -79,7 +79,9 @@ export const getConfig = (): IDiagnosticsConfig => { export type TDiagnosticKey = string; /** Each provider should return an object of this format. The key of the provider defines the schema. */ -export type TDiagnosticResult = { ok: boolean; warn?: string } & { [key: string]: unknown }; +export type TDiagnosticResult = { ok: boolean; warn?: string; empty?: boolean } & { + [key: string]: unknown; +}; /** Implemented by objects that want to provide data to the diagnostic check */ export interface IDiagnosticProvider { @@ -155,7 +157,7 @@ const runProvider = async (provider, log) => { { diagnostic: provider.key, ...result }, "Got diagnostic provider result with ok=true but a warning", ); - else if (log) + else if (log && !result.empty) logger.info({ diagnostic: provider.key, ...result }, "Diagnostic provider result"); return recordDiagnostic(startMs, provider.key, result); } catch (err) { diff --git a/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/postgres/postgres.ts b/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/postgres/postgres.ts index 6534ca1f..209bc206 100644 --- a/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/postgres/postgres.ts +++ b/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/postgres/postgres.ts @@ -99,7 +99,7 @@ export class PostgresConnector extends AbstractConnector