Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
06d05950
Commit
06d05950
authored
Dec 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor activity set removing stuff no longer needed
parent
c90af4d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
lib/gitlab/user/activity_set.rb
lib/gitlab/user/activity_set.rb
+5
-7
No files found.
lib/gitlab/user/activity_set.rb
View file @
06d05950
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment