mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Automatic conversion at start-up given correct conditions
This commit is contained in:
parent
3b5002aac8
commit
6130908285
@ -86,12 +86,18 @@ public class IndexService extends Service {
|
||||
}
|
||||
|
||||
private void autoConvert() {
|
||||
if (!servicesFactory.isConvertedIndexMissing() || !servicesFactory.isPreconvertedIndexPresent()) {
|
||||
if (!servicesFactory.isConvertedIndexMissing()
|
||||
|| !servicesFactory.isPreconvertedIndexPresent()
|
||||
|| Boolean.getBoolean("no-auto-convert")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
logger.info("Auto-converting");
|
||||
searchSetsService.recalculateAll();
|
||||
searchIndex.switchIndex();
|
||||
logger.info("Auto-conversion finished!");
|
||||
}
|
||||
catch (IOException ex) {
|
||||
logger.error("Auto convert failed", ex);
|
||||
|
@ -42,9 +42,8 @@ public class IndexServicesFactory {
|
||||
|
||||
private final Path searchSetsBase;
|
||||
|
||||
int LIVE_PART = 0;
|
||||
|
||||
int NEXT_PART = 1;
|
||||
final int LIVE_PART = 0;
|
||||
final int NEXT_PART = 1;
|
||||
|
||||
@Inject
|
||||
public IndexServicesFactory(
|
||||
@ -100,7 +99,6 @@ public class IndexServicesFactory {
|
||||
}
|
||||
|
||||
private void convertFullReverseIndex(DomainRankings domainRankings) throws IOException {
|
||||
|
||||
var source = writerIndexFile.get(0).toPath();
|
||||
|
||||
logger.info("Converting full reverse index {}", source);
|
||||
|
Loading…
Reference in New Issue
Block a user