Just experienced with commons. Dealt with UploadStashBadPathException
[lhc/web/wiklou.git] / maintenance / cleanupUploadStash.php
index 788f0f5..e46b853 100644 (file)
@@ -69,8 +69,13 @@ class UploadStashCleanup extends Maintenance {
                $stash = new UploadStash( $repo );
 
                foreach( $keys as $key ) {
-                       $stash->getFile( $key, true );
-                       $stash->removeFileNoAuth( $key );
+                       try {
+                               $stash->getFile( $key, true );
+                               $stash->removeFileNoAuth( $key );
+                       } catch ( UploadStashBadPathException $ex ) {
+                               $this->output( 'Failed removing stashed upload with key:' . $key );
+                               continue;
+                       }
                }
        }
 }