Merge "Add an optional flag to force an online reindex"
This commit is contained in:
@@ -23,11 +23,15 @@ import com.google.gerrit.sshd.SshCommand;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.kohsuke.args4j.Argument;
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||
@CommandMetaData(name = "start", description = "Start the online reindexer")
|
||||
public class IndexStartCommand extends SshCommand {
|
||||
|
||||
@Option(name = "--force", usage = "force a re-index")
|
||||
private boolean force;
|
||||
|
||||
@Argument(index = 0, required = true, metaVar = "INDEX",
|
||||
usage = "index name to start")
|
||||
private String name;
|
||||
@@ -38,7 +42,7 @@ public class IndexStartCommand extends SshCommand {
|
||||
@Override
|
||||
protected void run() throws UnloggedFailure {
|
||||
try {
|
||||
if (luceneVersionManager.startReindexer(name)) {
|
||||
if (luceneVersionManager.startReindexer(name, force)) {
|
||||
stdout.println("Reindexer started");
|
||||
} else {
|
||||
stdout.println("Nothing to reindex, index is already the latest version");
|
||||
|
||||
Reference in New Issue
Block a user