Do not retry the ThumbnailRenderJob.
authorPetr Pchelko <ppchelko@wikimedia.org>
Thu, 11 Oct 2018 15:19:41 +0000 (08:19 -0700)
committerPetr Pchelko <ppchelko@wikimedia.org>
Thu, 11 Oct 2018 15:26:03 +0000 (08:26 -0700)
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

index f87a336..63575eb 100644 (file)
@@ -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;
+       }
 }