Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIRTY - Do not merge - Log failed itin checks and bus notifs #263

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.opentripplanner.middleware.utils.DateTimeUtils;
import org.opentripplanner.middleware.utils.I18nUtils;
import org.opentripplanner.middleware.utils.ItineraryUtils;
import org.opentripplanner.middleware.utils.JsonUtils;
import org.opentripplanner.middleware.utils.NotificationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -301,7 +302,9 @@ private boolean makeOTPRequestAndUpdateMatchingItineraryInternal() {
}

// If this point is reached, a matching itinerary was not found
LOG.warn("No comparison itinerary found in otp response for trip");
LOG.warn("No comparison itinerary found in otp response for trip - params: {}", JsonUtils.toJson(this.trip.otp2QueryParams));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. this. is not needed.

LOG.warn("No comparison itinerary found in otp response for trip - saved itinerary: {}", JsonUtils.toJson(this.trip.itinerary));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. this. is not needed.

LOG.warn("No comparison itinerary found in otp response for trip - OTP itineraries: {}", JsonUtils.toJson(otpResponse.plan.itineraries));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this guard against a NPE in case plan is null?


if (hasReachedMaxItineraryChecks()) {
// Check whether this trip should no longer ever be checked due to not having matching itineraries on any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public void cancelNotification(TravelerPosition travelerPosition) {
* Makes a call to the bus driver notification API, followed by a call to the bus priority API.
*/
private static void makeApiRequests(TravelerPosition travelerPosition, String body, String routeId, String action) {
LOG.info("Sending bus operator/priority requests: {}", body);

var httpStatus = postBusDriverNotification(body);
if (httpStatus == HttpStatus.OK_200) {
travelerPosition.trackedJourney.updateNotificationMessage(routeId, body);
Expand Down
Loading