diff options
Diffstat (limited to 'app/workers/concerns/worker_attributes.rb')
-rw-r--r-- | app/workers/concerns/worker_attributes.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/workers/concerns/worker_attributes.rb b/app/workers/concerns/worker_attributes.rb index eebea30655c..6f91418e38c 100644 --- a/app/workers/concerns/worker_attributes.rb +++ b/app/workers/concerns/worker_attributes.rb @@ -46,8 +46,14 @@ module WorkerAttributes set_class_attribute(:feature_category, :not_owned) end + # Special case: if a worker is not owned, get the feature category + # (if present) from the calling context. def get_feature_category - get_class_attribute(:feature_category) + feature_category = get_class_attribute(:feature_category) + + return feature_category unless feature_category == :not_owned + + Gitlab::ApplicationContext.current_context_attribute('meta.feature_category') || feature_category end def feature_category_not_owned? |