Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class CCDeferredEnqueuer < CCEnqueuer
def perform
@options[:source_object_class_name] = @base_class.constantize
counter_class = @options[:counter].constantize
counter = counter_class.new(nil, @options)
counter.save!
unmark_as_queued
Rails.logger.info { 'Updated counters from cache.' }
end
private
def enqueuer_name
'deferred'
end
def form_key
class_name = @options[:relation_class_name]
column_name = @options[:column]
instance_id = @options[:relation_id]
"cc::#{class_name}::#{instance_id}::#{column_name}::deferred"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment