From 83c81f5f9879fa6846b8653d9fc9d9817a4e5b8f Mon Sep 17 00:00:00 2001 From: Hendry Zheng Date: Wed, 19 Jul 2023 09:58:15 +0700 Subject: [PATCH] turn off logging --- backend/src/data-source.ts | 2 +- backend/src/services/bid.service.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/data-source.ts b/backend/src/data-source.ts index bfc2cf9..4442cb4 100644 --- a/backend/src/data-source.ts +++ b/backend/src/data-source.ts @@ -13,7 +13,7 @@ export const AppDataSource = new DataSource({ password: PGPASSWORD, database: PGDATABASE, synchronize: true, - logging: true, + logging: false, entities: entities, migrations: [ ], diff --git a/backend/src/services/bid.service.ts b/backend/src/services/bid.service.ts index 386468a..1971d2b 100644 --- a/backend/src/services/bid.service.ts +++ b/backend/src/services/bid.service.ts @@ -30,6 +30,10 @@ export class BidService { { itemStatus: ITEM_STATUS.PUBLISHED, itemExpiredAt: LessThan(new Date()) }, ] }); + if (!publishedItem.length) { + console.log(`SKIPPED - No Published Item yet`) + return; + } console.log(`1. Get list of published item and ended auction, publishedItem.length=`, publishedItem.length) // 2. Loop each ended auction item