From 0bc12651db86c9a33f01caeb3263540ee4295c38 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Mon, 18 May 2026 21:19:38 +0700 Subject: [PATCH] fix: clean up logger info message formatting and remove unused import in rate limit tests --- src/env.ts | 13 +++++++------ src/utils/telegram.ts | 4 +++- test/rateLimit.test.ts | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/env.ts b/src/env.ts index 694d362..2c95d5d 100644 --- a/src/env.ts +++ b/src/env.ts @@ -32,12 +32,13 @@ if (missing.length > 0) { export const config: AppConfig = { botToken: process.env.BOT_TOKEN!, - additionalBotTokens: process.env.NODE_ENV === 'test' - ? [] - : (process.env.ADDITIONAL_BOT_TOKENS || '') - .split(',') - .map((t) => t.trim()) - .filter((t) => t !== ''), + additionalBotTokens: + process.env.NODE_ENV === 'test' + ? [] + : (process.env.ADDITIONAL_BOT_TOKENS || '') + .split(',') + .map((t) => t.trim()) + .filter((t) => t !== ''), storageChatId: parseInt(process.env.STORAGE_CHANNEL_ID!, 10), baseUrl: process.env.BASE_URL!, databaseUrl: process.env.DATABASE_URL!, diff --git a/src/utils/telegram.ts b/src/utils/telegram.ts index 5a3a866..98ae9c5 100644 --- a/src/utils/telegram.ts +++ b/src/utils/telegram.ts @@ -30,7 +30,9 @@ const executeWithBotRetry = async ( attemptedBots++; if (attemptedBots < bots.length) { - logger.info(`Bot Index ${prevIndex} hit 429. Instantly rotating to Bot Index ${nextIndex}...`); + logger.info( + `Bot Index ${prevIndex} hit 429. Instantly rotating to Bot Index ${nextIndex}...`, + ); return executeWithBotRetry(action, retries, attemptedBots); } diff --git a/test/rateLimit.test.ts b/test/rateLimit.test.ts index da1c48f..fc655be 100644 --- a/test/rateLimit.test.ts +++ b/test/rateLimit.test.ts @@ -1,5 +1,5 @@ // @ts-nocheck -import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test'; +import { beforeEach, describe, expect, it, spyOn } from 'bun:test'; import logger from '../src/utils/logger'; import { checkRateLimit, cleanupRateLimitCache } from '../src/utils/rateLimit';