diff --git a/src/main/java/org/eclipsefoundation/git/eca/tasks/GithubRevalidationQueue.java b/src/main/java/org/eclipsefoundation/git/eca/tasks/GithubRevalidationQueue.java index dd52e71e8715961bec3479b53b211a02797e1484..02ea0c4e453cd800315fa47e1a522696d92960bc 100644 --- a/src/main/java/org/eclipsefoundation/git/eca/tasks/GithubRevalidationQueue.java +++ b/src/main/java/org/eclipsefoundation/git/eca/tasks/GithubRevalidationQueue.java @@ -75,7 +75,7 @@ public class GithubRevalidationQueue { * Every 5s, this method will attempt to load a Github webhook validation request that has the needs revalidation flag * set to true. This will retrieve the oldest request in queue and will attempt to revalidate it. */ - @Scheduled(every = "5s") + @Scheduled(every = "${eclipse.git-eca.tasks.gh-revalidation.frequency:60s}") @ActivateRequestContext public void revalidate() { // if not enabled, don't process any potentially OOD records @@ -114,6 +114,10 @@ public class GithubRevalidationQueue { .debug("Attempting revalidation of request w/ ID {}, in repo {}#{}", requestToRevalidate.getId(), requestToRevalidate.getRepositoryFullName(), requestToRevalidate.getPullRequestNumber()); + // update the number of times this status has revalidated (tracking) + requestToRevalidate + .setManualRevalidationCount(requestToRevalidate.getManualRevalidationCount() == null ? 1 + : requestToRevalidate.getManualRevalidationCount() + 1); // wrap in try-catch to avoid errors from stopping the record updates try { // split the full repo name into the org and repo name @@ -130,10 +134,6 @@ public class GithubRevalidationQueue { requestToRevalidate.setNeedsRevalidation(false); LOGGER.debug("Sucessfully revalidated request w/ ID {}", requestToRevalidate.getId()); } catch (RuntimeException e) { - // update the number of times this status has revalidated (tracking) - requestToRevalidate - .setManualRevalidationCount(requestToRevalidate.getManualRevalidationCount() == null ? 1 - : requestToRevalidate.getManualRevalidationCount() + 1); // log the message so we can see what happened LOGGER.error("Error while revalidating request w/ ID {}", requestToRevalidate.getId(), e); } finally {