Created
August 2, 2011 07:07
-
-
Save tsuna/1119725 to your computer and use it in GitHub Desktop.
TSDB query start time underflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/TsdbQuery.java b/src/core/TsdbQuery.java | |
index 2edd53c..8776e89 100644 | |
--- a/src/core/TsdbQuery.java | |
+++ b/src/core/TsdbQuery.java | |
@@ -401,7 +401,8 @@ final class TsdbQuery implements Query { | |
// but this doesn't really matter. | |
// Additionally, in case our sample_interval is large, we need to look | |
// even further before/after, so use that too. | |
- return getStartTime() - Const.MAX_TIMESPAN * 2 - sample_interval; | |
+ final long t = getStartTime() - Const.MAX_TIMESPAN * 2 - sample_interval; | |
+ return t > 0 ? t : 0; | |
} | |
/** Returns the UNIX timestamp at which we must stop scanning. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment