File size: 604 Bytes
c7fbc2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

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();