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

Merge branch 'malowe/main/148' into 'main'

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

See merge request !162
parents b6745155 2f8a2462
No related branches found
No related tags found
1 merge request!162Iss #148 - Update the revalidation queue to remove closed PRs from queue
Pipeline #32240 passed
......@@ -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