-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug?]: (Jobs) Environment is not correctly set in the Job worker #11569
Comments
Hmm, the log statement in both the service and the job is Jobs will load your |
Ah, my bad copy/paste on: The job itself reports: 11:51:32 🌲 [RedwoodJob] Started job 8 (LogEnvironmentJob/LogEnvironmentJob:LogEnvironmentJob)
11:51:32 🌲 LogEnvironmentJob is performing...
11:51:32 🌲 The environment in the service <---- this is really the job
11:51:32 🚦 LogEnvironmentJob is undefined
11:51:32 🌲 LogEnvironmentJob is done After my typo fix with just 02:11:19 🐛 [rw-jobs-worker.*.0] Checking for jobs in all (*) queues...
02:11:19 🌲 [RedwoodJob] Started job 11 (LogEnvironmentJob/LogEnvironmentJob:LogEnvironmentJob)
02:11:19 🌲 LogEnvironmentJob is performing...
02:11:19 🌲 The environment in the job
02:11:19 🚦 LogEnvironmentJob is undefined in job
02:11:19 🌲 LogEnvironmentJob is done
02:11:19 🐛 [RedwoodJob] Job 11 success
02:11:19 🐛 [rw-jobs-worker.*.0] Checking for jobs in all (*) queues...
02:11:24 🐛 [rw-jobs-worker.*.0] Checking for jobs in all (*) queues... Have updated reproduction: https://github.com/dthyresson/jobs-environment |
…obs worker (#11572) This mimics the behavior of `yarn rw dev` where `NODE_ENV` will equal `development` if you don't set it explicitly. Because of this, you need to make sure you explicitly set it in other environments. You should set `NODE_ENV=production` in your `.env` file/Dockerfile on your production server, for example. The docs have been updated to note this. Closes #11569
What's not working?
Demonstrate that the environment is not correctly set in the job worker.
Knowing that the environment is correctly set the job will let a developer use different storage adapters per environment. For example, in the
development
environment, the job will use thefile
storage adapter, but in theproduction
environment, the job will use thes3
storage adapter.How do we reproduce the bug?
Steps to reproduce
See: https://github.com/dthyresson/jobs-environment for an example app
yarn dev
yarn jobs work
http://localhost:8910/graphql
Can see that the environment is correctly set in the service to
development
whenyarn rw dev
is running.However, when the jobs are running, the environment is undefined.
However, if you run the jobs with
NODE_ENV=development yarn rw jobs work
the environment is correctly set todevelopment
.What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: