Commit 06d05950 authored by James Lopez's avatar James Lopez

refactor activity set removing stuff no longer needed

parent c90af4d5
......@@ -6,8 +6,6 @@ module Gitlab
KEY = 'user/activities'
DEFAULT_FROM = 6.months.ago.to_i
attr_reader :page, :per_page
def self.record(user)
Gitlab::Redis.with do |redis|
redis.zadd(KEY, Time.now.to_i, user.username)
......@@ -41,11 +39,7 @@ module Gitlab
def raw_activities
Gitlab::Redis.with do |redis|
redis.zrangebyscore(KEY,
@from,
@to,
with_scores: true,
limit: [pagination_delegate.offset, pagination_delegate.limit_value])
redis.zrangebyscore(KEY, @from, @to, with_scores: true, limit: limit)
end
end
......@@ -54,6 +48,10 @@ module Gitlab
redis.zcount(KEY, @from, @to)
end
end
def limit
[pagination_delegate.offset, pagination_delegate.limit_value]
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment