Skip to content

Commit

Permalink
refactor(MonitorAllTripsJob): Fix active trip filter and checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 1, 2023
1 parent ca89702 commit d1d9a19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,12 @@ private long getMinutesUntilTrip() {
* calculated and updated in the monitored trip's journey state.
*/
public boolean shouldSkipMonitoredTripCheck() throws Exception {
// before anything else, return true if the trip is inactive
if (trip.isInactive()) {
LOG.info("Skipping: Trip is inactive.");
return true;
}

// get the configured timezone that OTP is using to parse dates and times
ZoneId targetZoneId = DateTimeUtils.getOtpZoneId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ public void run() {
*/
private static BasicDBObject makeTripFilter() {
BasicDBObject tripFilter = new BasicDBObject();

//.Trips must be active.
tripFilter.put("isInactive", false);
tripFilter.put("isActive", true);

// Other conditions (e.g. in CheckMonitoredTrip) that would result in a trip to be not checked
// should eventually be moved here.
Expand Down

0 comments on commit d1d9a19

Please sign in to comment.