Closed joaoreberti closed 1 year ago
@typescript-eslint/no-misused-promises
thanks in advance, great library by the way 🚀
import PgBoss from 'pg-boss'; async function doSomethingAsyncWithThis(data: any): Promise<void> { // Implement your function here await new Promise((resolve) => { resolve(data); }); } async function someAsyncJobHandler(job: PgBoss.Job<any>): Promise<void> { console.log(`job ${job.id} received with data:`); console.log(JSON.stringify(job.data)); await doSomethingAsyncWithThis(job.data); } async function readme(): Promise<void> { const boss: PgBoss = new PgBoss('postgres://user:pass@host/database'); boss.on('error', (error: Error) => console.error(error)); await boss.start(); const queue: string = 'some-queue'; const jobId = await boss.send(queue, { param1: 'foo' }); console.log(`created job in queue ${queue}: ${jobId}`); await boss.work(queue, someAsyncJobHandler); } readme();
This should be resolved in 9.0.1
The new release fixed the issue 🙏
Summary
@typescript-eslint/no-misused-promises
rulethanks in advance, great library by the way 🚀