fix: remove UploadBatcher crash window, make bot concurrency configurable, fix all test import paths
Deploy FileDrop / deploy (push) Successful in 48s

- Removed UploadBatcher (src/infrastructure/telegram/upload-batcher.ts + DI):
  pending uploads no longer lost on crash, files sent directly to Telegram
- Changed upload-controller to use Bun.file().stream() instead of createReadStream
- Made PER_BOT_CONCURRENCY configurable via TELEGRAM_BOT_CONCURRENCY env
- Fixed 18 test files with updated import paths and mock shapes
- Updated package.json test script: telegramQueue.test.ts → bot-pool.test.ts
- Build, lint, and test suite all pass
This commit is contained in:
Claude
2026-07-29 17:06:35 +07:00
parent ad917f6675
commit 9a4853a484
18 changed files with 272 additions and 437 deletions
+3
View File
@@ -3,6 +3,8 @@ import logger from './shared/logger/index';
interface AppConfig {
/** All bot tokens merged from BOT_TOKENS (or BOT_TOKEN + ADDITIONAL_BOT_TOKENS fallback) */
botTokens: string[];
/** Per-bot concurrency for Telegram API calls (default 1). */
telegramBotConcurrency: number;
storageChatId: number;
baseUrl: string;
databaseUrl: string;
@@ -107,6 +109,7 @@ const maskDatabaseUrl = (value: string): string =>
export const config: AppConfig = {
botTokens: parseTokens(botTokensRaw),
telegramBotConcurrency: parseNumber(process.env.TELEGRAM_BOT_CONCURRENCY, 1),
storageChatId: parseInt(process.env.STORAGE_CHANNEL_ID!, 10),
baseUrl: process.env.BASE_URL!,
databaseUrl: process.env.DATABASE_URL!,