Commit e5a18d23 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Document deduplicating jobs in the future

This adds a blurb about the including_scheduled option that can be
passed to the `UntilExecuting` strategy.
parent 0f9c506c
......@@ -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