-
-
Save brunomichetti/800bdc372a7539809ab59ac97777e30e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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