summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2018-09-04 09:33:01 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2018-09-04 09:33:01 +0200
commitc9db91dbb32422baf6a3be0ed14d0811b3c2e098 (patch)
treee74d756754072be4090886f5cca6e043ef391932
parente437381af9176828e906af26d8e0e6301ea1bd5a (diff)
squash! Reduce database size and variance of query response times.
- Very minor bug: Fix the relevant_statuses field for the edge case of querying the date before the first date in the database. The bug is that allDates contains milliseconds since the epoch truncated to the current day. If we want to check whether a date is contained, we'll have to check for a similarly truncated timestamp. Would have gone unnoticed for the majority of cases, and will be easier to get right after switching to Java 8 date/time types.
-rw-r--r--src/main/java/org/torproject/metrics/exonerator/QueryServlet.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/torproject/metrics/exonerator/QueryServlet.java b/src/main/java/org/torproject/metrics/exonerator/QueryServlet.java
index 4edf88b..a807ad0 100644
--- a/src/main/java/org/torproject/metrics/exonerator/QueryServlet.java
+++ b/src/main/java/org/torproject/metrics/exonerator/QueryServlet.java
@@ -396,7 +396,7 @@ public class QueryServlet extends HttpServlet {
response.lastDateInDatabase = dateFormat.format(allDates.last());
response.relevantStatuses = allDates.contains(timestamp)
|| allDates.contains(timestamp - MILLISECONDS_IN_A_DAY)
- || allDates.contains(timestamp + 2 * MILLISECONDS_IN_A_DAY - 1L);
+ || allDates.contains(timestamp + MILLISECONDS_IN_A_DAY);
}
if (matchesByAddress.containsKey(relayIp)) {
List<QueryResponse.Match> matchesList