Use correct schedulers for blocking operations

This commit is contained in:
Andrea Cavalli 2021-03-02 12:01:03 +01:00
parent 7a33d8d1d5
commit d9e1d38390
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
private static final ColumnFamilyDescriptor DEFAULT_COLUMN_FAMILY = new ColumnFamilyDescriptor(
RocksDB.DEFAULT_COLUMN_FAMILY);
private static final Supplier<Scheduler> lowMemorySupplier = Suppliers.memoize(() ->
Schedulers.newSingle("db-low-memory"))::get;
Schedulers.newBoundedElastic(1, Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, "db-low-memory", Integer.MAX_VALUE))::get;
private final Scheduler dbScheduler;
private final Path dbPath;

View File

@ -82,7 +82,7 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
true
);
private static final Supplier<Scheduler> lowMemorySupplier = Suppliers.memoize(() ->
Schedulers.newSingle("lucene-low-memory"))::get;
Schedulers.newBoundedElastic(1, Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, "lucene-low-memory", Integer.MAX_VALUE))::get;
/**
* Lucene query scheduler.
*/