Revert "Make the duration error message more specific (#5755)" (#5758)

This commit is contained in:
吴晟 Wu Sheng 2020-10-31 02:39:05 +08:00 committed by GitHub
parent 7881ba32db
commit 3c32ad10dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -30,8 +30,6 @@ import org.joda.time.format.DateTimeFormatter;
public enum DurationUtils {
INSTANCE;
private static final int MAX_TIME_SPAN = 500;
private static final DateTimeFormatter YYYY_MM_DD = DateTimeFormat.forPattern("yyyy-MM-dd");
private static final DateTimeFormatter YYYY_MM_DD_HH = DateTimeFormat.forPattern("yyyy-MM-dd HH");
private static final DateTimeFormatter YYYY_MM_DD_HHMM = DateTimeFormat.forPattern("yyyy-MM-dd HHmm");
@ -121,11 +119,9 @@ public enum DurationUtils {
break;
}
i++;
if (i > MAX_TIME_SPAN) {
if (i > 500) {
throw new UnexpectedException(
"Duration data error, the span between the start time and the end time is too large, step: "
+ step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket
+ ", max time span: " + MAX_TIME_SPAN);
"Duration data error, step: " + step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket);
}
}
while (endTimeBucket != durations.get(durations.size() - 1).getPoint());