Skip to content

Commit 6a216ee

Browse files
committed
minor fixes
1 parent 095d688 commit 6a216ee

File tree

1 file changed

+12
-2
lines changed
  • cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/uaa

1 file changed

+12
-2
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/uaa/UaaThrottler.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,19 @@ private UaaThrottler() {
6262
public void addLimiterMapping(LimiterMapping mapping) {
6363
mappings.add(new LimiterMappingWithRunningRequests(mapping));
6464
int delay = mapping.timeBase();
65-
if (minDelay > delay) {
65+
if (minDelay > delay && delay > 0) {
6666
minDelay = delay;
6767
}
68+
if (mapping.limit() > 10000) {
69+
LOGGER.info(
70+
"UaaThrottler: using a huge value for rate limit might slow down execution when"
71+
+ " back-pressure is high.");
72+
LOGGER.info(
73+
"UaaThrottler: Mapping "
74+
+ mapping.name()
75+
+ " uses a limit of "
76+
+ mapping.limit());
77+
}
6878
}
6979

7080
public Mono<Token> acquire(String url) {
@@ -111,7 +121,7 @@ private synchronized Mono<Token> tryAcquire(String url, Sinks.One<Void> waiter)
111121
* @param url
112122
* @return
113123
*/
114-
synchronized boolean checkDelayNeededAndResume(String url) {
124+
boolean checkDelayNeededAndResume(String url) {
115125
Instant now = Instant.now();
116126
Set<Token> removed = new HashSet<>();
117127
try {

0 commit comments

Comments
 (0)