e6fcdd7aca
On reload, references to Metrics within classes in the Gitlab::Metrics module fail. Update all references to ::Gitlab::Metrics so that constant lookup finds the right module in development. This fix should not impact production.
18 lines
424 B
Ruby
18 lines
424 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ReactiveCachingWorker
|
|
include ApplicationWorker
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
def perform(class_name, id, *args)
|
|
klass = begin
|
|
class_name.constantize
|
|
rescue NameError
|
|
nil
|
|
end
|
|
return unless klass
|
|
|
|
klass.find_by(klass.primary_key => id).try(:exclusively_update_reactive_cache!, *args)
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|