-
Hi, We would like to run a job every few minutes to retrieve updated application configuration through an API and modify the contents of process.env. We were considering using Bree for this, but are concerned about the fact that Bree uses worker threads, which means its process.env would merely be a copy of the main process.env and any changes made to it would not be reflected in the original. In the Nodejs documentation at https://nodejs.org/docs/latest-v16.x/api/worker_threads.html#class-worker it says:
In Bree's README(https://github.com/breejs/bree#custom-worker-options) it hints that worker creation options can be specified, but there are no examples of how this can be done. Could someone please provide an example of setting SHARE_ENV to true when creating workers without messing up any of the other default options? P.S. We understand there are feature management frameworks that can be used to achieve the outcome we are working towards, but at the moment, we would like to implement this home-grown workaround. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Putting this here in case someone lands on this thread looking for an answer. This is how to configure the worker thread of a particular job to share the process.env with the main thread:
|
Beta Was this translation helpful? Give feedback.
Putting this here in case someone lands on this thread looking for an answer. This is how to configure the worker thread of a particular job to share the process.env with the main thread: