mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Add waitForSlave() wrapper function to Echo Database wrapper"
This commit is contained in:
commit
5f27ea2c8d
|
@ -29,6 +29,11 @@ class MWEchoDbFactory {
|
|||
|
||||
/**
|
||||
* Create a db factory instance from default Echo configuration
|
||||
* DO NOT use singleton in here because job queue may run
|
||||
* against multiple wikis, having a singleton would result in
|
||||
* wrong db configuration. In addition, singleton is not necessary
|
||||
* because it's actually handled inside core database object
|
||||
*
|
||||
* @return MWEchoDbFactory
|
||||
*/
|
||||
public static function newFromDefault() {
|
||||
|
@ -63,7 +68,11 @@ class MWEchoDbFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wrapper function for wfGetDB
|
||||
* Wrapper function for wfGetDB, some extensions like MobileFrontend is
|
||||
* using this to issue sql queries against Echo database directly. This
|
||||
* is totally not accepted and should be updated to use Echo database access
|
||||
* objects
|
||||
*
|
||||
* @deprecated Use newFromDefault() instead to create a db factory
|
||||
* @param $db int Index of the connection to get
|
||||
* @param $groups mixed Query groups.
|
||||
|
@ -84,4 +93,11 @@ class MWEchoDbFactory {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for the slaves of the database
|
||||
*/
|
||||
public function waitForSlaves() {
|
||||
wfWaitForSlaves( false, $this->wiki, $this->cluster );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue