RippleWorkers / src /scripts /test-queue.ts
damndeepesh
Initialize project with LavinMQ integration and Docker support
c7fbc2e
Raw History Blame Contribute Delete
604 Bytes
import { enqueuePublishJob } from "@/lib/queue/producer";
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({ path: path.resolve(process.cwd(), '.env.local') });
async function main() {
console.log("Enqueueing test job...");
try {
await enqueuePublishJob("test-post-id-123");
console.log("Job enqueued successfully.");
// Wait a bit to let the worker process it (if running)
await new Promise(r => setTimeout(r, 2000));
process.exit(0);
} catch (e) {
console.error("Failed:", e);
process.exit(1);
}
}
main();