Commit 06506f3e authored by Fjen Undso's avatar Fjen Undso
Browse files

VoteController: consider only the last vote of an owner for stats

parent e0540838
......@@ -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;
}
}
......
Supports Markdown
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