Brion VIBBER has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336909 )

Change subject: Add --missing option to requeueTranscodes.php
......................................................................

Add --missing option to requeueTranscodes.php

Allows queueing only those that have been defined but are missing,
without touching things that have errored out etc.

Change-Id: If586ee4af2404c83ebb3d2743985e07779538a8d
---
M maintenance/requeueTranscodes.php
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/09/336909/1

diff --git a/maintenance/requeueTranscodes.php 
b/maintenance/requeueTranscodes.php
index c52c0db..229e01c 100644
--- a/maintenance/requeueTranscodes.php
+++ b/maintenance/requeueTranscodes.php
@@ -17,6 +17,8 @@
                $this->addOption( "error", "re-queue formats that previously 
failed", false, false );
                $this->addOption( "stalled", "re-queue formats that were 
started but not finished",
                        false, false );
+               $this->addOption( "missing", "queue formats that were never 
started",
+                       false, false );
                $this->addOption( "all", "re-queue all output formats", false, 
false );
                $this->mDescription = "re-queue existing and missing media 
transcodes.";
        }
@@ -51,6 +53,8 @@
                $transcodeSet = array_merge( $wgEnabledTranscodeSet, 
$wgEnabledAudioTranscodeSet );
                $dbw = wfGetDB( DB_MASTER );
 
+               $state = WebVideoTranscode::cleanupTranscodes( $file );
+
                if ( $this->hasOption( "all" ) ) {
                        $toAdd = $toRemove = $transcodeSet;
                } elseif ( $this->hasOption( "key" ) ) {
@@ -69,10 +73,13 @@
                                        $toRemove[] = $key;
                                        continue;
                                }
+                               if ( $this->hasOption( 'missing' ) &&
+                                       ( !$item['time_addjob'] ) ) {
+                                       $toRemove[] = $key;
+                                       continue;
+                               }
                        }
                }
-
-               $state = WebVideoTranscode::cleanupTranscodes( $file );
 
                if ( $toRemove ) {
                        $state = WebVideoTranscode::getTranscodeState( $file, 
$dbw );

-- 
To view, visit https://gerrit.wikimedia.org/r/336909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If586ee4af2404c83ebb3d2743985e07779538a8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to