fix: clean up logger info message formatting and remove unused import in rate limit tests
This commit is contained in:
+7
-6
@@ -32,12 +32,13 @@ if (missing.length > 0) {
|
|||||||
|
|
||||||
export const config: AppConfig = {
|
export const config: AppConfig = {
|
||||||
botToken: process.env.BOT_TOKEN!,
|
botToken: process.env.BOT_TOKEN!,
|
||||||
additionalBotTokens: process.env.NODE_ENV === 'test'
|
additionalBotTokens:
|
||||||
? []
|
process.env.NODE_ENV === 'test'
|
||||||
: (process.env.ADDITIONAL_BOT_TOKENS || '')
|
? []
|
||||||
.split(',')
|
: (process.env.ADDITIONAL_BOT_TOKENS || '')
|
||||||
.map((t) => t.trim())
|
.split(',')
|
||||||
.filter((t) => t !== ''),
|
.map((t) => t.trim())
|
||||||
|
.filter((t) => t !== ''),
|
||||||
storageChatId: parseInt(process.env.STORAGE_CHANNEL_ID!, 10),
|
storageChatId: parseInt(process.env.STORAGE_CHANNEL_ID!, 10),
|
||||||
baseUrl: process.env.BASE_URL!,
|
baseUrl: process.env.BASE_URL!,
|
||||||
databaseUrl: process.env.DATABASE_URL!,
|
databaseUrl: process.env.DATABASE_URL!,
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ const executeWithBotRetry = async (
|
|||||||
attemptedBots++;
|
attemptedBots++;
|
||||||
|
|
||||||
if (attemptedBots < bots.length) {
|
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);
|
return executeWithBotRetry(action, retries, attemptedBots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck
|
// @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 logger from '../src/utils/logger';
|
||||||
import { checkRateLimit, cleanupRateLimitCache } from '../src/utils/rateLimit';
|
import { checkRateLimit, cleanupRateLimitCache } from '../src/utils/rateLimit';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user