Fix spammy "Writes done" debug message
authorTim Starling <tstarling@wikimedia.org>
Fri, 13 Feb 2015 04:56:39 +0000 (15:56 +1100)
committerTim Starling <tstarling@wikimedia.org>
Fri, 13 Feb 2015 04:59:37 +0000 (15:59 +1100)
Was broken by I1a8830eaf, which accidentally caused the log message to
be output for every write query, instead of only the first write query.

Change-Id: I4a53914bcb28804ff4c31b4e0418591793d411b6

includes/db/Database.php

index 896b621..538facb 100644 (file)
@@ -1083,8 +1083,11 @@ abstract class DatabaseBase implements IDatabase {
 
                $isWriteQuery = $this->isWriteQuery( $sql );
                if ( $isWriteQuery ) {
+                       if ( !$this->mDoneWrites ) {
+                               wfDebug( __METHOD__ . ': Writes done: ' .
+                                       DatabaseBase::generalizeSQL( $sql ) . "\n" );
+                       }
                        # Set a flag indicating that writes have been done
-                       wfDebug( __METHOD__ . ': Writes done: ' . DatabaseBase::generalizeSQL( $sql ) . "\n" );
                        $this->mDoneWrites = microtime( true );
                }