Skip to content
Snippets Groups Projects

Iss #148 - Update the revalidation queue to remove closed PRs from queue

Merged Iss #148 - Update the revalidation queue to remove closed PRs from queue
Merged Martin Lowe requested to merge (removed):malowe/main/148 into main
1 file
+ 8
1
Compare changes
  • Side-by-side
  • Inline
@@ -137,8 +137,15 @@ public class GithubRevalidationQueue {
// log the message so we can see what happened
LOGGER.error("Error while revalidating request w/ ID {}", requestToRevalidate.getId(), e);
} finally {
// whether successful or failed, update the updated field
// whether successful or failed, update the updated time field
requestToRevalidate.setLastUpdated(DateTimeHelper.now());
// if in a closed state, we shouldn't try to revalidate again as it will never be valid
// if a PR is reopened, it should create a new event and validate anyways
if ("closed".equalsIgnoreCase(requestToRevalidate.getLastKnownState())) {
LOGGER.debug("Tracking request {} set to not revalidate as it was closed", requestToRevalidate.getId());
requestToRevalidate.setNeedsRevalidation(false);
}
// push the update with the potentially updated validation flag or error count
dao.add(new RDBMSQuery<>(wrap, filters.get(GithubWebhookTracking.class)), Arrays.asList(requestToRevalidate));
}
Loading