Module: Octo::Scheduleable

Included in:
ApiHit, CategoryBaseline, CategoryHit, NewsfeedHit, NotificationHit, ProductBaseline, ProductHit, TagBaseline, TagHit
Defined in:
lib/octocore-cassandra/schedeuleable.rb

Instance Method Summary collapse

Instance Method Details

#perform(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/octocore-cassandra/schedeuleable.rb', line 6

def perform(*args)
  type = args[0].to_sym

  if Octo::Counter.constants.include?type
    if type == :TYPE_MINUTE and self.respond_to?(:aggregate!)
      aggregate!
    else
      method_name = type_counters_method_names type
      send(method_name.to_sym, Time.now.floor)
    end
  end
end