// Have the query manager tell the providers to initialize the indexes. This may cause a background reindexing ...
queryManager().reindexIfNeeded();
// Register the background processes.
// Do this last since we want the repository running before these are started ...
GarbageCollection gcConfig = config.getGarbageCollection();
String threadPoolName = gcConfig.getThreadPoolName();
long binaryGcInitialTimeInMillis = determineInitialDelay(gcConfig.getInitialTimeExpression());
long binaryGcIntervalInHours = gcConfig.getIntervalInHours();
int lockSweepIntervalInMinutes = gcConfig.getLockSweepIntervalInMinutes();
assert binaryGcInitialTimeInMillis >= 0;
long binaryGcIntervalInMillis = TimeUnit.MILLISECONDS.convert(binaryGcIntervalInHours, TimeUnit.HOURS);
ScheduledExecutorService garbageCollectionService = this.context.getScheduledThreadPool(threadPoolName);
backgroundProcesses.add(garbageCollectionService.scheduleAtFixedRate(new LockGarbageCollectionTask(
JcrRepository.this),