Skip to content

Commit

Permalink
Merge pull request #131 from Netflix/refreshpool.1
Browse files Browse the repository at this point in the history
don't queue tasks if queue is not empty
  • Loading branch information
pkarumanchi9 authored Nov 9, 2022
2 parents 047e055 + 82be6ab commit 4bdd49a
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1482,17 +1482,17 @@ public void refreshPool() {
public void refreshPool(boolean async, boolean force) {
if (log.isDebugEnabled()) log.debug("Refresh Pool : async : " + async + "; force : " + force);
try {
if(async) {
asyncRefreshExecutor.submit(new Runnable() {
@Override
public void run() {
try {
refresh(force);
} catch (Exception e) {
log.error(e.getMessage(), e);
if(async && asyncRefreshExecutor.getQueue().size() == 0) {
asyncRefreshExecutor.submit(new Runnable() {
@Override
public void run() {
try {
refresh(force);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
});
});
} else {
refresh(force);
}
Expand Down

0 comments on commit 4bdd49a

Please sign in to comment.