New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit pending image transforms in GeneratePendingTransforms job #7360
Comments
Where are you seeing those ImageMagick temp files? |
But that is kind of besides the point... do we expect the transformJob to resize 2000+ images in (the default) 300 seconds. |
Well typically there wouldn’t be… transforms only get added to that queue when their URL has been requested by a template. Do you know what is triggering these? Just a bunch of front-end web requests? |
That background job shouldn’t be getting queued up for GraphQL requests in the first place: cms/src/controllers/GraphqlController.php Lines 156 to 157 in 48dffa2
Are you doing something to override that? In any case, this might be a good case for using either ImageOptimize or Imager X, both of which can offload transform generation to imgix, which is a better transform solution for larger loads. |
I don't think the job itself is getting queued by the graphql call. And the page that calls the graphql query will try to render one of the images, which triggers the job. I guess the Anyway, can't we just disable the GeneratePendingTransforms job? so images only get transformed when requested? |
Ah gotcha. And sorry, I missed the I just added a new property that you can override to prevent these jobs from getting added, for the next 3.6 release. To get the change early, change your Then open return [
'components' => [
'assets' => [
'generatePendingTransformsViaQueue' => false,
],
],
]; |
Hi Brandon, We found out when you use this setting it can give problems with the cache tag in twig. |
Craft 3.6 has now been officially released ✨ |
@martijnvanonz Sorry, missed your question. The |
Description
When adding webp transforms to an existing site, it will trigger an enormous amount of pending image transforms (2000+)
When this job tries to transform all of them at once the job will most likely hit its timeout (which leaves imagemagick tmp files around)
Is it an idea to limit the query in this job to a maximum? or an option to disable generating images in the background as a temporary solution?
cms/src/queue/jobs/GeneratePendingTransforms.php
Line 24 in 35eafe4
For example:
cms/src/services/AssetTransforms.php
Lines 953 to 959 in 35eafe4
with a
->limit(50)
Steps to reproduce
Additional info
CP Field Inspect 1.2.3
Entry Instructions 1.0.7
Environment protection 1.1.1
Field Manager 2.2.2
Position Fieldtype 1.0.16
Redactor 2.8.5
SEO 3.6.7
Super Table 2.6.5
The text was updated successfully, but these errors were encountered: