huge refactor done
This commit is contained in:
parent
843a7b9b9b
commit
60d7de1da8
16 changed files with 472 additions and 443 deletions
31
apps/stock/data-ingestion/scripts/trigger-job.ts
Normal file
31
apps/stock/data-ingestion/scripts/trigger-job.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import Redis from 'ioredis';
|
||||
import { Queue } from 'bullmq';
|
||||
|
||||
const redis = new Redis({
|
||||
host: 'localhost',
|
||||
port: 6379,
|
||||
db: 0,
|
||||
});
|
||||
|
||||
const queue = new Queue('{data-ingestion_webshare}', {
|
||||
connection: redis,
|
||||
});
|
||||
|
||||
async function triggerJob() {
|
||||
console.log('Triggering webshare fetch-proxies job...');
|
||||
|
||||
const job = await queue.add('fetch-proxies', {
|
||||
handler: 'webshare',
|
||||
operation: 'fetch-proxies',
|
||||
payload: {},
|
||||
});
|
||||
|
||||
console.log(`Job ${job.id} added to queue`);
|
||||
|
||||
await redis.quit();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
triggerJob().catch(console.error);
|
||||
Loading…
Add table
Add a link
Reference in a new issue