jenkins-bot has submitted this change and it was merged.

Change subject: Replace job->insert() calls
......................................................................


Replace job->insert() calls

Change-Id: I4d4249a62c489ab3e4e2e229ba4326a7e27a0d0c
---
M WebVideoTranscode/WebVideoTranscode.php
M maintenance/resetTranscodes.php
2 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/WebVideoTranscode/WebVideoTranscode.php 
b/WebVideoTranscode/WebVideoTranscode.php
index 2e041b9..0ada0c4 100644
--- a/WebVideoTranscode/WebVideoTranscode.php
+++ b/WebVideoTranscode/WebVideoTranscode.php
@@ -1187,10 +1187,11 @@
                                'transcodeKey' => $transcodeKey,
                        ] );
 
-                       if ( $job->insert() ) {
+                       try {
+                               JobQueueGroup::singleton()->push( $job );
                                // Clear the state cache ( now that we have 
updated the page )
                                self::clearTranscodeCache( $fileName );
-                       } else {
+                       } catch ( Exception $ex ) {
                                // Adding job failed, update transcode row
                                $db->update(
                                        'transcode',
diff --git a/maintenance/resetTranscodes.php b/maintenance/resetTranscodes.php
index 4677c7d..ffb2605 100644
--- a/maintenance/resetTranscodes.php
+++ b/maintenance/resetTranscodes.php
@@ -31,7 +31,7 @@
                                'transcodeMode' => 'derivative',
                                'transcodeKey' => $row->transcode_key,
                        ] );
-                       $job->insert();
+                       JobQueueGroup::singleton()->push( $job );
                }
        }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d4249a62c489ab3e4e2e229ba4326a7e27a0d0c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to