Fix missing scheduling locks
This commit is contained in:
parent
c676fa63a7
commit
84c5fb93a0
@ -130,11 +130,14 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
|
||||
}
|
||||
|
||||
private void registerScheduledFixedTask(Runnable task, Duration duration) {
|
||||
scheduledTasksLifecycle.registerScheduledTask(scheduler.scheduleAtFixedRate(task,
|
||||
duration.toMillis(),
|
||||
duration.toMillis(),
|
||||
TimeUnit.MILLISECONDS
|
||||
));
|
||||
scheduledTasksLifecycle.registerScheduledTask(scheduler.scheduleAtFixedRate(() -> {
|
||||
scheduledTasksLifecycle.startScheduledTask();
|
||||
try {
|
||||
task.run();
|
||||
} finally {
|
||||
scheduledTasksLifecycle.endScheduledTask();
|
||||
}
|
||||
}, duration.toMillis(), duration.toMillis(), TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -401,7 +404,9 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
|
||||
|
||||
private void scheduledQueryRefresh() {
|
||||
try {
|
||||
searcherManager.maybeRefreshBlocking();
|
||||
if (!searcherManager.maybeRefresh()) {
|
||||
// skipped refreshing because another thread is currently refreshing
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user