Skip to content

Commit 9f77a94

Browse files
Update PrivacyIDEA.java
1 parent e6eb252 commit 9f77a94

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/java/org/privacyidea/PrivacyIDEA.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class PrivacyIDEA implements Closeable
3838
private final BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(1000);
3939
private final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(20, 20, 10, TimeUnit.SECONDS, queue);
4040
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
41-
private final CountDownLatch authTokenLatch = new CountDownLatch(1);
41+
private CountDownLatch authTokenLatch = new CountDownLatch(1);
4242
final JSONParser parser;
4343
// Responses from these endpoints will not be logged. The list can be overwritten.
4444
private List<String> logExcludedEndpoints = Arrays.asList(PIConstants.ENDPOINT_AUTH,
@@ -380,6 +380,9 @@ private void retrieveAuthToken()
380380

381381
// Count down the latch to indicate that the token is retrieved
382382
authTokenLatch.countDown();
383+
384+
// Create a new CountDownLatch for the next token retrieval
385+
authTokenLatch = new CountDownLatch(1);
383386
}
384387

385388
/**

0 commit comments

Comments
 (0)