summaryrefslogtreecommitdiff
path: root/app/workers/concerns/worker_attributes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/concerns/worker_attributes.rb')
-rw-r--r--app/workers/concerns/worker_attributes.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/concerns/worker_attributes.rb b/app/workers/concerns/worker_attributes.rb
index b60179531af..b19217b15de 100644
--- a/app/workers/concerns/worker_attributes.rb
+++ b/app/workers/concerns/worker_attributes.rb
@@ -111,6 +111,28 @@ module WorkerAttributes
1
end
+ def tags(*values)
+ worker_attributes[:tags] = values
+ end
+
+ def get_tags
+ Array(worker_attributes[:tags])
+ end
+
+ def deduplicate(strategy, options = {})
+ worker_attributes[:deduplication_strategy] = strategy
+ worker_attributes[:deduplication_options] = options
+ end
+
+ def get_deduplicate_strategy
+ worker_attributes[:deduplication_strategy] ||
+ Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob::DEFAULT_STRATEGY
+ end
+
+ def get_deduplication_options
+ worker_attributes[:deduplication_options] || {}
+ end
+
protected
# Returns a worker attribute declared on this class or its parent class.