Skip to content

Commit

Permalink
Use queue#take instead of poll (#3765)
Browse files Browse the repository at this point in the history
* Use queue#take instead of poll to avoid cs (#3764)

* update CHANGES.md

* update CHANGES.md

Co-authored-by: kezhenxu94 <[email protected]>
Co-authored-by: wxq <[email protected]>
Co-authored-by: Jason Song <[email protected]>
  • Loading branch information
4 people authored Jun 28, 2021
1 parent 1b3424f commit d5200df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Apollo 1.9.0
* [feat(apollo-client): add method interestedChangedKeys to ConfigChangeEvent](https://github.com/ctripcorp/apollo/pull/3666)
* [add More... link for known users](https://github.com/ctripcorp/apollo/pull/3757)
* [update OIDC documentation](https://github.com/ctripcorp/apollo/pull/3766)
* [Use queue#take instead of poll](https://github.com/ctripcorp/apollo/pull/3765)
* [feature: add Spring Boot 2.4 config data loader support](https://github.com/ctripcorp/apollo/pull/3754)
* [feat(open-api): get authorized apps](https://github.com/ctripcorp/apollo/pull/3647)
* [feature: shared session for multi apollo portal](https://github.com/ctripcorp/apollo/pull/3786)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ public void afterPropertiesSet() throws Exception {
auditExecutorService.submit(() -> {
while (!auditStopped.get() && !Thread.currentThread().isInterrupted()) {
try {
InstanceConfigAuditModel model = audits.poll();
if (model == null) {
TimeUnit.SECONDS.sleep(1);
continue;
}
InstanceConfigAuditModel model = audits.take();
doAudit(model);
} catch (Throwable ex) {
Tracer.logError(ex);
Expand Down

0 comments on commit d5200df

Please sign in to comment.