r107058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107057‎ | r107058 | r107059 >
Date:11:43, 22 December 2011
Author:j
Status:ok
Tags:
Comment:
bind temp file and purge after encoding to prevent deletion/race condition on the temp file name.

follow up r106956
Modified paths:
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -190,6 +190,8 @@
191191 );
192192 WebVideoTranscode::invalidatePagesWithFile( $this->title );
193193 }
 194+ //remove temoprary file in any case
 195+ $this->getTargetEncodePath()->purge();
194196 } else {
195197 // Update the transcode table with failure time and error
196198 $dbw->update(
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php
@@ -164,6 +164,7 @@
165165 if ( !$tmpFile ) {
166166 return False;
167167 }
 168+ $tmpFile->bind( $file );
168169 return $tmpFile->getPath(); //path with 0-byte temp file
169170 }
170171

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106956Encode videos in temp and only add to FileRepo once done.j16:50, 21 December 2011

Status & tagging log