Skip to content

Commit 6cb749b

Browse files
committed
MAGE-1281 Change conditional logic per review
1 parent 28c12b5 commit 6cb749b

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

Service/ReplicaSettingsHandler.php

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,34 @@ public function setSettings(
3636
string $mergeSettingsFrom = ''
3737
): void
3838
{
39-
if ($this->config->shouldForwardPrimaryIndexSettingsToReplicas($indexOptions->getStoreId())) {
40-
[$forward, $noForward] = $this->splitSettings($indexSettings);
41-
if ($forward) {
42-
$this->connector->setSettings(
43-
$indexOptions,
44-
$forward,
45-
true,
46-
false
47-
);
48-
}
49-
if ($noForward) {
50-
$this->connector->setSettings(
51-
$indexOptions,
52-
$noForward,
53-
false,
54-
true,
55-
$mergeSettingsFrom
56-
);
57-
}
58-
} else {
39+
if (!$this->config->shouldForwardPrimaryIndexSettingsToReplicas($indexOptions->getStoreId())) {
5940
$this->connector->setSettings(
6041
$indexOptions,
6142
$indexSettings,
6243
false,
6344
true,
6445
$mergeSettingsFrom
6546
);
47+
return;
48+
}
49+
50+
[$forward, $noForward] = $this->splitSettings($indexSettings);
51+
if ($forward) {
52+
$this->connector->setSettings(
53+
$indexOptions,
54+
$forward,
55+
true,
56+
false
57+
);
58+
}
59+
if ($noForward) {
60+
$this->connector->setSettings(
61+
$indexOptions,
62+
$noForward,
63+
false,
64+
true,
65+
$mergeSettingsFrom
66+
);
6667
}
6768
}
6869

0 commit comments

Comments
 (0)