Remove --max-slave-lag options and remnants from maintenance scripts
[lhc/web/wiklou.git] / includes / api / ApiStashEdit.php
index b32d332..3457670 100644 (file)
@@ -159,7 +159,7 @@ class ApiStashEdit extends ApiBase {
         * @param ParserOptions $pstOpts Options for $pstContent (MUST be for prospective author)
         * @param ParserOptions $pOpts Options for $pOut
         * @param string $timestamp TS_MW timestamp of parser output generation
-        * @return boolean Success
+        * @return bool Success
         */
        public static function stashEditFromPreview(
                Page $page, Content $content, Content $pstContent, ParserOutput $pOut,
@@ -239,7 +239,9 @@ class ApiStashEdit extends ApiBase {
                                $wgMemc->unlock( $key );
                        }
                        $sec = microtime( true ) - $start;
-                       wfDebugLog( 'StashEdit', "Waited $sec seconds on '$key'." );
+                       if ( $sec > .01 ) {
+                               wfDebugLog( 'StashEdit', "Waited $sec seconds on '$key'." );
+                       }
                }
 
                if ( !is_object( $editInfo ) || !$editInfo->output ) {
@@ -331,6 +333,7 @@ class ApiStashEdit extends ApiBase {
                // If an item is renewed, mind the cache TTL determined by config and parser functions
                $since = time() - wfTimestamp( TS_UNIX, $parserOutput->getTimestamp() );
                $ttl = min( $parserOutput->getCacheExpiry() - $since, 5 * 60 );
+
                if ( $ttl > 0 && !$parserOutput->getFlag( 'vary-revision' ) ) {
                        // Only store what is actually needed
                        $stashInfo = (object)array(