Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MilderJoghurt
rlf-server
Commits
06506f3e
Commit
06506f3e
authored
Jun 29, 2015
by
Fjen Undso
Browse files
VoteController: consider only the last vote of an owner for stats
parent
e0540838
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/VoteController.java
View file @
06506f3e
...
...
@@ -119,7 +119,8 @@ public class VoteController extends Controller {
tenMinutesAgo
=
new
Date
(
tenMinutesAgo
.
getTime
()
-
(
10
*
60000
));
// get all votes of last 10 minutes
for
(
Vote
v
:
session
.
votes
)
{
List
<
Vote
>
sessionVotes
=
Vote
.
find
.
where
().
eq
(
"session"
,
session
).
orderBy
(
"date desc"
).
findList
();
for
(
Vote
v
:
sessionVotes
)
{
if
(
v
.
date
.
after
(
tenMinutesAgo
))
{
switch
(
v
.
type
)
{
case
SPEED:
...
...
@@ -144,6 +145,9 @@ public class VoteController extends Controller {
break
;
}
usersAll
.
add
(
v
.
owner
);
}
else
{
// do not process old votes
break
;
}
}
...
...
Write
Preview
Supports
Markdown
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