From a1de209ca8422c2b0845d9006aa5c8838a969d30 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 18 Apr 2024 17:54:59 +0800 Subject: [PATCH] better logs --- src/database/index.ts | 3 +-- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/database/index.ts b/src/database/index.ts index 9fe4ad5c..d2fc419e 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -85,9 +85,8 @@ export class Database { } async acquireWriteLock() { - console.log("acquiring 2"); const client = await this.#connectionPool.connect(); - console.log("acquiring 3"); + // generate lock id based on schema const lockId = this.databaseSchemaName.split("").reduce((acc, char) => { return acc + char.charCodeAt(0); diff --git a/src/index.ts b/src/index.ts index 5f4d44f8..c202f00e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -181,7 +181,7 @@ async function main(): Promise { } async function indexChains(isFirstRun = false) { - console.log("acquiring"); + baseLogger.info("attempting to acquire write lock"); const lock = await db.acquireWriteLock(); if (lock !== null) {