Skip to content
Snippets Groups Projects
Commit 2f8a2462 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

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

Previously, we had high frequency revalidations where the PR was closed,
which will never pass.
parent d492924d
No related branches found
No related tags found
1 merge request!162Iss #148 - Update the revalidation queue to remove closed PRs from queue
......@@ -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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment