New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent unnecessary RBAC users request #567
Conversation
quarkus.cache.caffeine.rbac-recipient-users-provider-get-users.expire-after-write=PT10M | ||
quarkus.cache.caffeine.rbac-recipient-users-provider-get-group-users.expire-after-write=PT10M |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested by @pilhuhn on Slack yesterday.
Prod is currently caching data for 1 minute (the 5 minute increase hasn't been deployed).
52d32c4
to
bffc224
Compare
@@ -119,7 +119,7 @@ public void initCounters() { | |||
AtomicInteger::new, | |||
state -> fetcher.apply(state.getAndIncrement()) | |||
) | |||
.until(page -> page.getData().isEmpty()) | |||
.whilst(page -> page.getData().size() == rbacElementsPerPage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the time, this will prevent one RBAC request per recipients resolution.
See this for details about until
and whilst
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an error in the Javadoc BTW: until
stops when the predicates passes (the Javadoc says the opposite).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From reading the Javadoc, whilst()
is really what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.