feat(api): 开发auth、login等接口,规范格式化
This commit is contained in:
+11
-8
@@ -3,22 +3,25 @@ import IORedis from 'ioredis';
|
||||
|
||||
// 显式构造客户端实例传给 BullMQ:原生 ESM(pnpm start)下 BullMQ 无法按 connection
|
||||
// 选项自动加载 ioredis;maxRetriesPerRequest: null 是 BullMQ Worker 的要求
|
||||
const connection = new IORedis(process.env.REDIS_URL ?? 'redis://localhost:6379', {
|
||||
maxRetriesPerRequest: null,
|
||||
});
|
||||
const connection = new IORedis(
|
||||
process.env.REDIS_URL ?? 'redis://localhost:6379',
|
||||
{
|
||||
maxRetriesPerRequest: null,
|
||||
},
|
||||
);
|
||||
const dispatchQueue = new Queue('atlas-dispatch', { connection });
|
||||
|
||||
async function bootstrap() {
|
||||
await dispatchQueue.waitUntilReady();
|
||||
console.info(
|
||||
'Atlas Worker is ready; it will consume transactional-outbox events after that module exists.',
|
||||
);
|
||||
await dispatchQueue.waitUntilReady();
|
||||
console.info(
|
||||
'Atlas Worker is ready; it will consume transactional-outbox events after that module exists.',
|
||||
);
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
|
||||
async function shutdown() {
|
||||
await dispatchQueue.close();
|
||||
await dispatchQueue.close();
|
||||
}
|
||||
|
||||
process.once('SIGINT', () => void shutdown());
|
||||
|
||||
Reference in New Issue
Block a user