Skip to content

Commit

Permalink
concord-server: fix PolicyCache reloading loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ibodrov committed Jan 14, 2025
1 parent 2f6f43a commit 8265025
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

import static com.walmartlabs.concord.server.jooq.Tables.POLICIES;
import static com.walmartlabs.concord.server.jooq.Tables.POLICY_LINKS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

public class PolicyCache implements BackgroundTask {

Expand Down Expand Up @@ -176,7 +177,9 @@ private void run() {
if (lastRefreshRequestAt > now) {
lastRefreshRequestAt = now;
} else {
refreshMutex.wait(cacheCfg.getReloadInterval().toMillis());
//noinspection ResultOfMethodCallIgnored
refreshMutex.newCondition()
.await(cacheCfg.getReloadInterval().toMillis(), MILLISECONDS);
}
} finally {
refreshMutex.unlock();
Expand Down

0 comments on commit 8265025

Please sign in to comment.