RomainLanz / adonis-bull-queue

Queue system based on BullMQ for AdonisJS
MIT License
147 stars 26 forks source link

Cannot specific queueName when dispatch job. #12

Closed miinion closed 1 year ago

miinion commented 2 years ago

` import { Queue } from '@ioc:Setten/Queue';

Queue.dispatch('App/Jobs/RegisterStripeCustomer', {...}, { queueName: 'stripe', }); `

This produce errors when compiling project

[ error ] typescript compiler errors app/Controllers/Http/CronJobController.ts:75:17 - error TS2769: No overload matches this call. Overload 1 of 2, '(job: "App/Jobs/CalculateUserStat", payload: CalculateUserStatPayload, options?: JobsOptions | undefined): Promise<string>', gave the following error. Argument of type '{ queueName: string; }' is not assignable to parameter of type 'JobsOptions'. Object literal may only specify known properties, and 'queueName' does not exist in type 'JobsOptions'. Overload 2 of 2, '(job: "App/Jobs/CalculateUserStat", payload: CalculateUserStatPayload, options?: JobsOptions | undefined): Promise<string>', gave the following error. Argument of type '{ queueName: string; }' is not assignable to parameter of type 'JobsOptions'. Object literal may only specify known properties, and 'queueName' does not exist in type 'JobsOptions'.

RomainLanz commented 2 years ago

Yes, this has not been released yet!

I will first update BullMQ and add some testing before releasing this feature.