Page MenuHomePhabricator

Replace wfGetDB() by injecting new Db-Service in Repo's DispatchStats class
Closed, ResolvedPublic

Description

Note that wfGetDB() uses \Wikimedia\Rdbms\LoadBalancer::getMaintenanceConnectionRef internally. Check if that connection ref is really necessary for this use case.

Also note from the documentation of wfGetDB():

* Note 3: When replacing calls to this with calls to methods on an injected
* LoadBalancer, LoadBalancer::getConnectionRef is more commonly needed than
* LoadBalancer::getMaintenanceConnectionRef, which is needed for more advanced
* administrative tasks. See the IMaintainableDatabase and IDatabase interfaces
* for details.

Acceptance Criteria:

  • wfGetDB() is no longer used in DispatchStats
  • wfGetDB() is no longer used in tests for this class

Event Timeline

Change 703591 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/Wikibase@master] Avoid using wfGetDB in DispatchStats

https://gerrit.wikimedia.org/r/703591

Change 703591 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Avoid using wfGetDB in DispatchStats

https://gerrit.wikimedia.org/r/703591