You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On drop job.done commit, the type definitions was changed
With that change I'm no longer able to use async handlers without using an ignore rule due to @typescript-eslint/no-misused-promises rule
Since the example in the readme file has an async handler I assume this was an oversight of some sorts.
But perhaps I'm missing something
thanks in advance, great library by the way 🚀
importPgBossfrom'pg-boss';asyncfunctiondoSomethingAsyncWithThis(data: any): Promise<void>{// Implement your function hereawaitnewPromise((resolve)=>{resolve(data);});}asyncfunctionsomeAsyncJobHandler(job: PgBoss.Job<any>): Promise<void>{console.log(`job ${job.id} received with data:`);console.log(JSON.stringify(job.data));awaitdoSomethingAsyncWithThis(job.data);}asyncfunctionreadme(): Promise<void>{constboss: PgBoss=newPgBoss('postgres://user:pass@host/database');boss.on('error',(error: Error)=>console.error(error));awaitboss.start();constqueue: string='some-queue';constjobId=awaitboss.send(queue,{param1: 'foo'});console.log(`created job in queue ${queue}: ${jobId}`);awaitboss.work(queue,someAsyncJobHandler);}readme();
The text was updated successfully, but these errors were encountered:
Summary
@typescript-eslint/no-misused-promises
rulethanks in advance, great library by the way 🚀
The text was updated successfully, but these errors were encountered: