Skip to content

Commit 82cee31

Browse files
committed
fix(redis): use IORedis instance with URL for BullMQ connection
1 parent f1a55f6 commit 82cee31

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"Bash(git -C \"c:/Users/MSI/Desktop/Proyectos Github/InvoiceScan\" status --short)",
1313
"Bash(git -C \"c:/Users/MSI/Desktop/Proyectos Github/InvoiceScan\" log --oneline -6)",
1414
"Bash(git -C \"c:/Users/MSI/Desktop/Proyectos Github/InvoiceScan\" status -b --short)",
15-
"Bash(git -C \"c:/Users/MSI/Desktop/Proyectos Github/InvoiceScan\" log origin/main..HEAD --oneline)"
15+
"Bash(git -C \"c:/Users/MSI/Desktop/Proyectos Github/InvoiceScan\" log origin/main..HEAD --oneline)",
16+
"Bash(pnpm --filter backend typecheck)"
1617
]
1718
}
1819
}

packages/backend/src/app.module.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { ExpressAdapter } from '@bull-board/express';
2323
import { EventEmitterModule } from '@nestjs/event-emitter';
2424
import { LoggerModule } from 'nestjs-pino';
2525
import { trace } from '@opentelemetry/api';
26+
import IORedis from 'ioredis';
2627
import { DatabaseModule } from './infrastructure/db/database.module';
2728
import { InvoicesModule } from './invoices.module';
2829
import { AdminModule } from './admin.module';
@@ -38,7 +39,10 @@ import { EXPORT_INVOICE_QUEUE } from './infrastructure/queue/export-queue.servic
3839

3940
const config = validateConfig();
4041

41-
const redisUrl = new URL(config.REDIS_URL);
42+
const redisConnection = new IORedis(config.REDIS_URL, {
43+
maxRetriesPerRequest: null,
44+
enableReadyCheck: false,
45+
});
4246

4347
/**
4448
* Bull Board solo se monta fuera de producción.
@@ -105,14 +109,7 @@ const bullBoardModules =
105109

106110
// Configuración global de Redis para BullMQ
107111
BullModule.forRoot({
108-
connection: {
109-
host: redisUrl.hostname,
110-
port: Number(redisUrl.port) || 6379,
111-
...(redisUrl.password && {
112-
password: decodeURIComponent(redisUrl.password),
113-
}),
114-
...(redisUrl.username && { username: redisUrl.username }),
115-
},
112+
connection: redisConnection as never,
116113
}),
117114

118115
// Bull Board UI — solo activo fuera de producción

0 commit comments

Comments
 (0)