Merge "Improving message when needing to reindex"
This commit is contained in:
commit
7c99ef88d8
@ -113,6 +113,11 @@ public class LuceneVersionManager implements LifecycleListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
|
String runReindex =
|
||||||
|
"No index versions ready; run java -jar " +
|
||||||
|
sitePaths.gerrit_war.toAbsolutePath() +
|
||||||
|
" reindex";
|
||||||
|
|
||||||
FileBasedConfig cfg;
|
FileBasedConfig cfg;
|
||||||
try {
|
try {
|
||||||
cfg = loadGerritIndexConfig(sitePaths);
|
cfg = loadGerritIndexConfig(sitePaths);
|
||||||
@ -121,10 +126,10 @@ public class LuceneVersionManager implements LifecycleListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Files.exists(sitePaths.index_dir)) {
|
if (!Files.exists(sitePaths.index_dir)) {
|
||||||
throw new ProvisionException("No index versions ready; run Reindex");
|
throw new ProvisionException(runReindex);
|
||||||
} else if (!Files.exists(sitePaths.index_dir)) {
|
} else if (!Files.exists(sitePaths.index_dir)) {
|
||||||
log.warn("Not a directory: %s", sitePaths.index_dir.toAbsolutePath());
|
log.warn("Not a directory: %s", sitePaths.index_dir.toAbsolutePath());
|
||||||
throw new ProvisionException("No index versions ready; run Reindex");
|
throw new ProvisionException(runReindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeMap<Integer, Version> versions = scanVersions(cfg);
|
TreeMap<Integer, Version> versions = scanVersions(cfg);
|
||||||
@ -148,7 +153,7 @@ public class LuceneVersionManager implements LifecycleListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (search == null) {
|
if (search == null) {
|
||||||
throw new ProvisionException("No index versions ready; run Reindex");
|
throw new ProvisionException(runReindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
markNotReady(cfg, versions.values(), write);
|
markNotReady(cfg, versions.values(), write);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user