Commit b614bcec authored by fdeppe's avatar fdeppe
Browse files

added some logic for pause feature

parent 44f60200
......@@ -100,11 +100,13 @@ public class VoteController extends Controller {
VoteStats sUnderstandability = new VoteStats(VoteStats.Type.UNDERSTANDABILITY, 0);
VoteStats sRequests = new VoteStats(VoteStats.Type.REQUEST, 0);
VoteStats sUsers = new VoteStats(VoteStats.Type.CURRENTUSERS, 0);
VoteStats sBreakRequests = new VoteStats(VoteStats.Type.BREAK, 0);
List<VoteStats> vsList = new ArrayList<VoteStats>();
vsList.add(sAll);
vsList.add(sSpeed);
vsList.add(sUnderstandability);
vsList.add(sRequests);
vsList.add(sBreakRequests);
vsList.add(sUsers);
// distinct list of vote owners
......@@ -141,6 +143,12 @@ public class VoteController extends Controller {
sRequests.value++;
}
break;
case BREAK:
// consider only last 10min
if (v.date.after(tenMinutesAgo)) {
sBreakRequests.value++;
}
break;
default:
break;
}
......
......@@ -49,6 +49,9 @@ public class Vote extends Model {
@EnumValue("R")
REQUEST,
@EnumValue("B")
BREAK,
}
public static Finder<Long, Vote> find = new Finder<Long, Vote>(Long.class,
......
......@@ -20,6 +20,7 @@ public class VoteStats extends Model {
UNDERSTANDABILITY,
REQUEST,
CURRENTUSERS,
BREAK,
}
public VoteStats(Type type, Integer value) {
......
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