in src/main/java/com/googlesource/gerrit/plugins/replication/Init.java [43:69]
public void run() throws Exception {
File configFile = site.etc_dir.resolve(pluginName + ".config").toFile();
if (!configFile.exists()) {
return;
}
FileBasedConfig config = new FileBasedConfig(configFile, FS.DETECTED);
config.load();
for (String name : config.getSubsections("remote")) {
if (!Strings.isNullOrEmpty(config.getString("remote", name, "rescheduleDelay"))) {
continue;
}
int replicationDelay =
config.getInt("remote", name, "replicationDelay", DEFAULT_REPLICATION_DELAY);
if (replicationDelay > 0) {
int delay = Math.max(replicationDelay, DEFAULT_RESCHEDULE_DELAY);
ui.message("Setting remote.%s.rescheduleDelay = %d\n", name, delay);
config.setInt("remote", name, "rescheduleDelay", delay);
} else {
ui.message(
"INFO: Assuming default (%d s) for remote.%s.rescheduleDelay\n",
DEFAULT_RESCHEDULE_DELAY, name);
}
}
config.save();
}