From f814691538578972bdeefe574e74a8dacb261a59 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 20 Jul 2024 18:01:27 +0800 Subject: [PATCH] refactor: skip event report if not have any events --- src/server/cronjob/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/cronjob/index.ts b/src/server/cronjob/index.ts index 6901b13..e532a94 100644 --- a/src/server/cronjob/index.ts +++ b/src/server/cronjob/index.ts @@ -368,7 +368,15 @@ async function checkFeedEventsNotify( }, }); - sendFeedEventsNotify(channel, events); + if (events.length === 0) { + logger.info( + 'Skip send events report because not include any events in this channel', + channel.id + ); + return; + } + + await sendFeedEventsNotify(channel, events); }, { concurrency: 5,