Skip to content

Commit d045e7e

Browse files
committed
feat(AutoPublishJob.java): Notify subscribers if auto publish fails
1 parent 1f13778 commit d045e7e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/conveyal/datatools/manager/jobs/AutoPublishJob.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,19 @@ protected void innerJobLogic() throws Exception {
5454
}
5555
}
5656

57-
// If validation successful, just execute the feed updating process.
5857
if (!status.error) {
58+
// Validation successful, just execute the feed updating process.
5959
FeedVersionController.publishToExternalResource(latestFeedVersion);
6060
LOG.info("Auto-published feed source {} to external resource.", feedSource.id);
61+
} else {
62+
// Notify feed and project subscribed users of failure.
63+
String message = String.format(
64+
"WARNING: Auto-published feed source %s failed to deploy. Error: %s.",
65+
feedSource.name,
66+
status.message
67+
);
68+
NotifyUsersForSubscriptionJob.createNotification("feed-updated", feedSource.id, message);
69+
NotifyUsersForSubscriptionJob.createNotification("project-updated", feedSource.projectId, message);
6170
}
6271
}
6372
}

0 commit comments

Comments
 (0)