Add waitForSlave() wrapper function to Echo Database wrapper

Plus a couple of comments update

Change-Id: I1678cd1cfde88806a15b280532ecfc6cf2672e38
This commit is contained in:
bsitu 2014-08-18 14:55:04 -07:00
parent 75cda20a31
commit f781a594d4

View file

@ -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 );
}
}