r106386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106385‎ | r106386 | r106387 >
Date:22:22, 15 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Time logging, and another \n
Modified paths:
  • /trunk/tools/rotatebot/rotbot.php (modified) (history)
  • /trunk/tools/rotatebot/upload.php (modified) (history)

Diff [purge]

Index: trunk/tools/rotatebot/rotbot.php
@@ -773,7 +773,7 @@
774774 }
775775
776776 mysql_close($myslink); // TODO should/can this be moved to function suicide? - Probably not due to line 33.
777 -suicide ("Bot finished.");
 777+suicide ("Bot finished.\n");
778778 // END script
779779
780780
Index: trunk/tools/rotatebot/upload.php
@@ -118,8 +118,11 @@
119119 }
120120 $dc += strlen($bo)+3;
121121 fputs($fp, "Content-length: $dc \n");
 122+ logfile( "Content-length: $dc" );
122123 fputs($fp, "\n");
123124
 125+ $startTime = time();
 126+
124127 foreach($data_l as $key=>$val)
125128 {
126129 if ($key == "file.file")
@@ -142,6 +145,9 @@
143146 $res .= fread($fp, 1);
144147 }
145148 fclose($fp);
 149+ $endTime = time();
 150+ $diff = $endTime - $startTime;
 151+ logfile( "Time taken: " . intval($diff) . " seconds" );
146152 global $homedir;
147153 file_put_contents( $homedir . "cache/log.txt",$res);
148154 return $res;

Status & tagging log