User "Catrope" changed the status of MediaWiki.r94592.

Old Status: new
New Status: ok

User "Catrope" also posted a comment on MediaWiki.r94592.

Full URL: 
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/94592#c20902
Commit summary:

Removed complex replag handling, now just query master when record isn't 
present on slave.
followup to r92009

Comment:

<pre>
+       protected function fetchFileMetadata( $key, $readFromMaster = false ) {
</pre>
Instead of using a meaningless boolean parameter (there are lots of legacy ones 
in MW, but we've turned against this style lately), please do something like 
<code>$readFromDBType = DB_SLAVE</code> which the caller then overrides to 
<code>DB_MASTER</code>. A call to <code>fetchfileMetadata( $key, DB_MASTER 
)</code> is more meaningful than a call to <code>fetchFileMetadata( $key, true 
)</code> .

(In normal cases, that means you can feed <code>$readFromDBType</code> directly 
into <code>wfGetDB()</code> as well, but your case is different because of the 
filerepo stuff.)

Otherwise OK, marking as such.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to