feat: 初始化项目
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Queue } from 'bullmq';
|
||||
|
||||
const connection = { url: process.env.REDIS_URL ?? 'redis://localhost:6379' };
|
||||
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.',
|
||||
);
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
|
||||
async function shutdown() {
|
||||
await dispatchQueue.close();
|
||||
}
|
||||
|
||||
process.once('SIGINT', () => void shutdown());
|
||||
process.once('SIGTERM', () => void shutdown());
|
||||
Reference in New Issue
Block a user