OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass additional parameters to job processor (separate file)

borkowsky opened this issue · comments

In my application, there was a need to share a common instance between JOB process files. Simply connecting the application initialization file is not suitable, since this does not save the settings table (I use ExpressJS); therefore, it is necessary to separate the common instance of ExpressJS App. How can I implement this?

To share a common instance of ExpressJS between multiple files or processes, you can create a module that exports the initialized Express app. This way, you can import this module in different files or processes, ensuring they all share the same instance of the Express app.

To share a common instance of ExpressJS between multiple files or processes, you can create a module that exports the initialized Express app. This way, you can import this module in different files or processes, ensuring they all share the same instance of the Express app.

App variables, setted up by another files not accessible in job process files. Result is undefined.