Skip to content

Commit

Permalink
[Fix] Prevent ConcurrentModificationException in ScheduledContextRemo…
Browse files Browse the repository at this point in the history
…ver.

The exception was likely caused by adding to the collection while it was being iterated during context removal.
  • Loading branch information
ledsoft committed Aug 12, 2024
1 parent fa79893 commit 47817b5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public synchronized void scheduleForRemoval(@NonNull URI contextUri) {
*/
@Transactional
@Scheduled(fixedRate = 1, timeUnit = TimeUnit.MINUTES)
public void runContextRemoval() {
public synchronized void runContextRemoval() {
LOG.trace("Running scheduled repository context removal.");
contextsToRemove.forEach(g -> {
LOG.trace("Dropping repository context {}.", Utils.uriToString(g));
Expand Down

0 comments on commit 47817b5

Please sign in to comment.