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 ...@@ -6,8 +6,6 @@ module Gitlab
KEY = 'user/activities' KEY = 'user/activities'
DEFAULT_FROM = 6.months.ago.to_i DEFAULT_FROM = 6.months.ago.to_i
attr_reader :page, :per_page
def self.record(user) def self.record(user)
Gitlab::Redis.with do |redis| Gitlab::Redis.with do |redis|
redis.zadd(KEY, Time.now.to_i, user.username) redis.zadd(KEY, Time.now.to_i, user.username)
...@@ -41,11 +39,7 @@ module Gitlab ...@@ -41,11 +39,7 @@ module Gitlab
def raw_activities def raw_activities
Gitlab::Redis.with do |redis| Gitlab::Redis.with do |redis|
redis.zrangebyscore(KEY, redis.zrangebyscore(KEY, @from, @to, with_scores: true, limit: limit)
@from,
@to,
with_scores: true,
limit: [pagination_delegate.offset, pagination_delegate.limit_value])
end end
end end
...@@ -54,6 +48,10 @@ module Gitlab ...@@ -54,6 +48,10 @@ module Gitlab
redis.zcount(KEY, @from, @to) redis.zcount(KEY, @from, @to)
end end
end end
def limit
[pagination_delegate.offset, pagination_delegate.limit_value]
end
end end
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