From beda625837de6c5af21523f6d92b2760ea67d777 Mon Sep 17 00:00:00 2001 From: Zack Pollard Date: Thu, 16 Jan 2025 16:04:24 +0000 Subject: [PATCH] chore: dont log postgres notices --- server/src/repositories/config.repository.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/repositories/config.repository.ts b/server/src/repositories/config.repository.ts index aef9c5f001f6be..67699880bd0bad 100644 --- a/server/src/repositories/config.repository.ts +++ b/server/src/repositories/config.repository.ts @@ -5,7 +5,7 @@ import { Request, Response } from 'express'; import { PostgresJSDialect } from 'kysely-postgres-js'; import { CLS_ID } from 'nestjs-cls'; import { join, resolve } from 'node:path'; -import postgres from 'postgres'; +import postgres, { Notice } from 'postgres'; import { citiesFile, excludePaths, IWorker } from 'src/constants'; import { Telemetry } from 'src/decorators'; import { EnvDto } from 'src/dtos/env.dto'; @@ -99,6 +99,11 @@ const getEnv = (): EnvData => { } const driverOptions = { + onnotice: (notice: Notice) => { + if (notice['severity'] !== 'NOTICE') { + console.warn('Postgres notice:', notice); + } + }, max: 10, types: { date: {