Commit b4b27440 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'bvl-explain-until-executing-docs' into 'master'

Document deduplicating jobs in the future

See merge request gitlab-org/gitlab!37121
parents 46510669 e5a18d23
......@@ -145,10 +145,27 @@ authorizations for both projects.
GitLab doesn't skip jobs scheduled in the future, as we assume that
the state will have changed by the time the job is scheduled to
execute.
execute. If you do want to deduplicate jobs scheduled in the future
this can be specified on the worker as follows:
More [deduplication strategies have been suggested](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/195). If you are implementing a worker that
could benefit from a different strategy, please comment in the issue.
```ruby
module AuthorizedProjectUpdate
class UserRefreshOverUserRangeWorker
include ApplicationWorker
deduplicate :until_executing, including_scheduled: true
idempotent!
# ...
end
end
```
This strategy is called `until_executing`. More [deduplication
strategies have been
suggested](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/195). If
you are implementing a worker that could benefit from a different
strategy, please comment in the issue.
If the automatic deduplication were to cause issues in certain
queues. This can be temporarily disabled by enabling a feature flag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment