Skip to content

How to work with CLS inside a bull queue #178

Answered by Papooch
pandektes-braedon asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, your idea is generally correct, and if you explicitly cast UseCls to any, then it should work as expected at runtime.
EDIT: The recommended solution has been added to the docs.

The issue here is that the UseCls decorator doesn't, for some reason, satisfy the general decorator interfaces that Nest's method expects. Likely becaue the UseCls decorator is generic and uses a bit of typescript magic to be type-safe according to the function on which you use it.

I'll try to investigate this more on my end and get back with other possible solutions.

Btw, if you don't want to repeat a decorator on each method of a class, you might try my decorate-all npm package, although you might bump into t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pandektes-braedon
Comment options

@Papooch
Comment options

Answer selected by pandektes-braedon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants