diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/ViewCountUpdate.php | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/ViewCountUpdate.php')
-rw-r--r-- | includes/ViewCountUpdate.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/includes/ViewCountUpdate.php b/includes/ViewCountUpdate.php index 28ba3414..22a46493 100644 --- a/includes/ViewCountUpdate.php +++ b/includes/ViewCountUpdate.php @@ -53,16 +53,13 @@ class ViewCountUpdate implements DeferrableUpdate { } # Not important enough to warrant an error page in case of failure - $oldignore = $dbw->ignoreErrors( true ); - - $dbw->insert( 'hitcounter', array( 'hc_id' => $this->id ), __METHOD__ ); - - $checkfreq = intval( $wgHitcounterUpdateFreq / 25 + 1 ); - if ( rand() % $checkfreq == 0 && $dbw->lastErrno() == 0 ) { - $this->collect(); - } - - $dbw->ignoreErrors( $oldignore ); + try { + $dbw->insert( 'hitcounter', array( 'hc_id' => $this->id ), __METHOD__ ); + $checkfreq = intval( $wgHitcounterUpdateFreq / 25 + 1 ); + if ( rand() % $checkfreq == 0 && $dbw->lastErrno() == 0 ) { + $this->collect(); + } + } catch ( DBError $e ) {} } protected function collect() { |