Skip to content

Commit

Permalink
fix(shared stops): fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-cline committed Sep 29, 2023
1 parent 7461805 commit 2cc547d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ public static Map<String, FeedVersionSummary> getLatestFeedVersionForFeedSources
unwind("$feedVersions"),
group(
"$_id",
Accumulators.first("feedVersionId", "$feedVersions._id"),
Accumulators.first("firstCalendarDate", "$feedVersions.validationResult.firstCalendarDate"),
Accumulators.first("lastCalendarDate", "$feedVersions.validationResult.lastCalendarDate"),
Accumulators.first("errorCount", "$feedVersions.validationResult.errorCount")
Accumulators.last("feedVersionId", "$feedVersions._id"),
Accumulators.last("firstCalendarDate", "$feedVersions.validationResult.firstCalendarDate"),
Accumulators.last("lastCalendarDate", "$feedVersions.validationResult.lastCalendarDate"),
Accumulators.last("errorCount", "$feedVersions.validationResult.errorCount")
)
);
return extractFeedVersionSummaries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void validate(MonitorableJob.Status status) {
status.update("Validating feed...", 33);

// Validate the feed version.
// Certain extensions, if enabled, have extra validators
// Certain extensions, if enabled, have extra validators.
if (isExtensionEnabled("mtc")) {
validationResult = GTFS.validate(feedLoadResult.uniqueIdentifier, DataManager.GTFS_DATA_SOURCE,
RouteTypeValidatorBuilder::buildRouteValidator,
Expand All @@ -384,9 +384,12 @@ public void validate(MonitorableJob.Status status) {
to support proprietary features.
*/
JDBCFetcher feedFetcher = new JDBCFetcher("feed_info");
Object gtfsFeedId = feedFetcher.getResults(this.namespace, null, null).get(0).get("feed_id");


Object gtfsFeedId = new Object();
try {
gtfsFeedId = feedFetcher.getResults(this.namespace, null, null).get(0).get("feed_id");
} catch (RuntimeException e) {
LOG.warn("RuntimeException occurred while fetching feedId");
}
String feedId = gtfsFeedId == null ? "" : gtfsFeedId.toString();
SharedStopsValidator ssv = new SharedStopsValidator(fs.retrieveProject(), feedId);

Expand Down

0 comments on commit 2cc547d

Please sign in to comment.