From: Petr Pchelko Date: Thu, 11 Oct 2018 15:19:41 +0000 (-0700) Subject: Do not retry the ThumbnailRenderJob. X-Git-Tag: 1.34.0-rc.0~3815^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=f57b3902ba85729de509a9c7c41049dc62500b28;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; + } }