diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/ScheduledContextRemover.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/ScheduledContextRemover.java index fb82b4228..326fe0ab0 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/ScheduledContextRemover.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/ScheduledContextRemover.java @@ -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));