Use container.replica as the property for readonly replicas

Change-Id: Ifd2f55107425bc6a1f9202d676694ba9c07d93c4
This commit is contained in:
Han-Wen Nienhuys
2019-10-14 18:56:01 +02:00
parent 34c43e775f
commit a51f1c0b32
8 changed files with 47 additions and 16 deletions

View File

@@ -20,6 +20,7 @@ import com.google.gerrit.lifecycle.LifecycleModule;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.group.db.Groups;
import com.google.gerrit.server.index.group.GroupIndexer;
import com.google.gerrit.server.util.ReplicaUtil;
import com.google.inject.Inject;
import com.google.inject.Scopes;
import java.io.IOException;
@@ -50,8 +51,8 @@ public class ReindexGroupsAtStartup implements LifecycleListener {
@Override
public void start() {
// Gerrit slaves without a reindex
if (cfg.getBoolean("container", "slave", false)
// Gerrit replicas without a reindex
if (ReplicaUtil.isReplica(cfg)
&& !cfg.getBoolean("index", "scheduledIndexer", "runOnStartup", true)) {
return;
}