Skip to content

Commit 06e46db

Browse files
authored
Disable replica DB config (#357)
1 parent fe33eca commit 06e46db

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Tags have the format: `<MediaWiki core version>-<PHP Version>-<date>-<build number>`
44

5+
## 1.39-7.4-20230524-0
6+
- Add condition for skipping Db replica config in case replica hostname is not set (empty string)
7+
58
## 1.39-7.4-20230522-0
69
- Allow email-confirmed users to add external urls (T327752)
710

dist-persist/wbstack/src/Settings/LocalSettings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
// For example schema generation or localization cache reload
121121
// WBS_DOMAIN=maint php ./w/maintenance/update.php --schema sql.sql --quick
122122
// As in these contexts there is often no replica.... and thus one would fail...
123-
if( !$wwDomainIsMaintenance ){
123+
// Also: skip the config if host name is empty. Useful in case replication breaks and we want to disable it.
124+
if( !$wwDomainIsMaintenance && !empty(getenv('MW_DB_SERVER_REPLICA'))){
124125
$wgDBservers[] = [
125126
'host' => getenv('MW_DB_SERVER_REPLICA'),
126127
'dbname' => $wgDBname,

dist/wbstack/src/Settings/LocalSettings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
// For example schema generation or localization cache reload
121121
// WBS_DOMAIN=maint php ./w/maintenance/update.php --schema sql.sql --quick
122122
// As in these contexts there is often no replica.... and thus one would fail...
123-
if( !$wwDomainIsMaintenance ){
123+
// Also: skip the config if host name is empty. Useful in case replication breaks and we want to disable it.
124+
if( !$wwDomainIsMaintenance && !empty(getenv('MW_DB_SERVER_REPLICA'))){
124125
$wgDBservers[] = [
125126
'host' => getenv('MW_DB_SERVER_REPLICA'),
126127
'dbname' => $wgDBname,

0 commit comments

Comments
 (0)