lib/tekeya/feed/activity/resque.rb in tekeya-0.0.4 vs lib/tekeya/feed/activity/resque.rb in tekeya-0.0.5
- old
+ new
@@ -7,11 +7,10 @@
included do
MAXTIMESTAMP = 10.days.ago.to_i unless defined?(MAXTIMESTAMP)
end
module ClassMethods
- private
# Writes the activity reference to the feed with the supplied key
#
# @param [String] feed_key the key of the feed where the activity will be referenced
# @param [Integer] score the score of the activity (timestamp) used to order the feed
# @param [String] activity_key a string containing the key to reference the activity
@@ -21,9 +20,10 @@
# increment the activity counter to keep track of its presence in feeds
activity_counter_key = "#{activity_key}:counter"
::Tekeya.redis.incr(activity_counter_key)
end
+ private
# Trims the feed according to the MAXTIMESTAMP set and returns the removed keys (for garbage collection)
#
# @param [String] feed_key a string containing the key of the feed to be trimed
def trim_feed(feed_key)
removed_keys = ::Tekeya.redis.zrevrangebyscore(feed_key, '-inf', MAXTIMESTAMP)
\ No newline at end of file