GithubHelp home page GithubHelp logo

Queue decorator has require params. about bull HOT 7 CLOSED

nestjs avatar nestjs commented on April 19, 2024
Queue decorator has require params.

from bull.

Comments (7)

fwoelffel avatar fwoelffel commented on April 19, 2024

Hi @klerick
Could you provide some code to reproduce the bug you encounter?

from bull.

klerick avatar klerick commented on April 19, 2024

@fwoelffel
Sorry,
I can not do it fast.
But it's easy to understand here
https://github.com/fwoelffel/nest-bull/blob/dev/lib/bull.explorer.ts#L30

from bull.

fwoelffel avatar fwoelffel commented on April 19, 2024

Ok I understand your concern. However, if you look at https://github.com/fwoelffel/nest-bull/blob/dev/lib/bull.explorer.ts#L98 and https://github.com/fwoelffel/nest-bull/blob/dev/lib/bull.utils.ts#L1 you'll understand that BullExplorer.getClassMetadata(metatype).queueName being undefined is not an issue at all.

I'll wait for a few days before closing this issue and I'll take a closer look at it if you find the time to provide some reproducibility code or if someone else can confirm.

from bull.

klerick avatar klerick commented on April 19, 2024

Firstly, yes, there is a value used by default. However if the name of a queue is set during the module configuration, then we have an error for the default value. I assume that it needs to return a more detailed error of what is going on. For example,

private static getBullQueue(moduleRef: ModuleRef, queueName?: string): Queue {
    try {
      return moduleRef.get<Queue>(getQueueToken(queueName));      
    } catch (e) {
        console.log("Queue 'queueName' not found")
      throw e
    }
  
}

or add details to the documentation.
For me the best solution is to set the name of the queue during the module configuration as required.

Secondly, a decorator @Queue has an interface

export interface QueueDecoratorOptions {
  name?: string; // Name of the queue
}

but

BullExplorer.getClassMetadata(metatype).queueName

tries to get a property queueName instead of name. As a result queueName is undefined and error returns.

from bull.

fwoelffel avatar fwoelffel commented on April 19, 2024

Damn! I'm so dumb. Yeah you're right. I'll fix this tonight. I'm sorry for the trouble.

from bull.

klerick avatar klerick commented on April 19, 2024

it happens. All that matters is that we’ve figured it out :)

from bull.

fwoelffel avatar fwoelffel commented on April 19, 2024

New release published as 0.6.2

from bull.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.