Skip to content
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

Dynamically set workerData #10

Closed
r00b opened this issue Jul 21, 2020 · 1 comment
Closed

Dynamically set workerData #10

r00b opened this issue Jul 21, 2020 · 1 comment

Comments

@r00b
Copy link
Contributor

r00b commented Jul 21, 2020

This is more of a question and not an issue--not sure where might be the best place to post. I can configure a worker with a workerData hash so that the scheduled job can have access to some seed data when it runs. However, is there a way to dynamically set this workerData hash on each run? Say I have a job that runs every 5 minutes, and every time it runs, I want to repopulate workerData with some data from another class in my project fetched via a getter, for example. Is that possible?

@niftylettuce
Copy link
Contributor

You could just modify the job data, it's exposed.

bree.config.jobs[3].workerData = {
  // some new data here
};

Then next time it runs it would use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants