Skip to content

Commit

Permalink
Fix config typo causing restart range to be no-op (#6)
Browse files Browse the repository at this point in the history
Change config check to verify if endTime is strictly larger than startTime
  • Loading branch information
kabochya authored and yuyang08 committed Sep 5, 2019
1 parent 2ee93bc commit 8adc8cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SingerConfigDef {
public static final String DAILY_RESTART_FLAG = "daily";
public static final String NUMBER_OF_FAILURES_ALLOWED = "numberOfFailuresAllowed";
public static final String DAILY_RESTART_TIME_BEGIN = "dailyRestartUtcTimeRangeBegin";
public static final String DAILY_RESTART_TIME_END = "dailyRestartUtcTimeRangeBegin";
public static final String DAILY_RESTART_TIME_END = "dailyRestartUtcTimeRangeEnd";

public static final String MONITOR_INTERVAL_IN_SECS = "monitorIntervalInSecs";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ private static SingerRestartConfig parseSingerRestartConfig(PropertiesConfigurat
.getString(SingerConfigDef.DAILY_RESTART_TIME_END);
Date startTime = SingerUtils.convertToDate(restartConfig.dailyRestartUtcTimeRangeBegin);
Date endTime = SingerUtils.convertToDate(restartConfig.dailyRestartUtcTimeRangeEnd);
if (endTime.compareTo(startTime) < 0) {
throw new ConfigurationException("Daily restart end time is earlier than start time");
if (endTime.compareTo(startTime) <= 0) {
throw new ConfigurationException("Daily restart end time is not later than start time");
}
}
return restartConfig;
Expand Down

0 comments on commit 8adc8cf

Please sign in to comment.