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
Explain locking and link to example #795
base: master
Are you sure you want to change the base?
Conversation
@@ -283,6 +283,16 @@ const agenda = new Agenda({maxConcurrency: 20}); | |||
Takes a `number` which specifies the default number of a specific job that can be running at | |||
any given moment. By default it is `5`. | |||
|
|||
The concurrency parameter is only important when the job takes longer than its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this is incorrect. Gonna throw together a minimal repo to try and confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've thrown this together: https://github.com/wingsbob/agenda-concurrency-example
You can run with different default concurrency levels by setting the environment variable CONCURRENCY
. The lock time is left as the default (10 mins), so that's definitely not coming into effect.
Agenda#every
might not be the best example for concurrency, as it creates single
type jobs, which seem to be semi-unique
|
||
* Multiple queues don't process the same job | ||
* The same job doesn't get run again before it has finished. For example, if a job | ||
is scheduled to run [`every`](#everyinterval-name-data-options-cb) 5 seconds but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use Job#repeatEvery
for this example
Is this able to be updated or should we close this? |
I hope examples will greatly help newcomers understand how Agenda works!