From f57b3902ba85729de509a9c7c41049dc62500b28 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 11 Oct 2018 08:19:41 -0700 Subject: [PATCH] Do not retry the ThumbnailRenderJob. The job is a warmup for the thumbnail cache, so loosing it is not an issue. Most of the times thumbnail rendering fails because of non-renderable or broken images, or because the thumbnail was already created by a request. These conditions will not be fixed by retrying, will only create more load on Thumbor. Bug: T203135 Change-Id: Ib4640eb13ca93f7350ff0671fc559a76ebbbb1e9 --- includes/jobqueue/jobs/ThumbnailRenderJob.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/jobqueue/jobs/ThumbnailRenderJob.php b/includes/jobqueue/jobs/ThumbnailRenderJob.php index f87a33691d..63575ebeca 100644 --- a/includes/jobqueue/jobs/ThumbnailRenderJob.php +++ b/includes/jobqueue/jobs/ThumbnailRenderJob.php @@ -134,4 +134,16 @@ class ThumbnailRenderJob extends Job { } return false; } + + /** + * Whether to retry the job. + * @return bool + */ + public function allowRetries() { + // ThumbnailRenderJob is a warmup for the thumbnails cache, + // so loosing it is not a problem. Most times the job fails + // for non-renderable or missing images which will not be fixed + // by a retry, but will create additional load on the renderer. + return false; + } } -- 2.20.1