Skip to content

Workers and process.env #212

Answered by tnabil
tnabil asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  const bree = new Bree({
    root: path.join(__dirname, '..', 'jobs'),
    logger: someLogger,
    defaultExtension: process.env.TS_NODE ? 'ts' : 'js',
    jobs: [
      {
        name: 'some-job-name',
        worker: {
          env: SHARE_ENV,
        },
      }
    ],
  });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tnabil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant