diff options
| author | Karsten Loesing <karsten.loesing@gmx.net> | 2018-09-04 09:33:01 +0200 |
|---|---|---|
| committer | Karsten Loesing <karsten.loesing@gmx.net> | 2018-09-04 09:33:01 +0200 |
| commit | c9db91dbb32422baf6a3be0ed14d0811b3c2e098 (patch) | |
| tree | e74d756754072be4090886f5cca6e043ef391932 | |
| parent | e437381af9176828e906af26d8e0e6301ea1bd5a (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.java | 2 |
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 |
