Skip to content
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

Issue with creating variants from different scenarios #335

Closed
JeanLucEsser opened this issue May 25, 2022 · 4 comments
Closed

Issue with creating variants from different scenarios #335

JeanLucEsser opened this issue May 25, 2022 · 4 comments
Labels

Comments

@JeanLucEsser
Copy link

JeanLucEsser commented May 25, 2022

So to continue our discussion from Discord.

I switched to S3 and AWS Sharp Image Transforms.
All images are still pointing to the local transform volume.
If I go to an asset and resave it, variants are generated and everything works fine.
So the logic next step is to make sure to re create all variants.

I tried to save a global as it is supposed to kick off a full resave but nothing happened (except for a quick search index job). Nothing related to ImageOptimize in queue.log either.

I tried to do a imageoptimize/optimize/create --force via the CLI but still nothing. Nothing related to ImageOptimize in console.log either.

So I tried to update asset indexes in the CP and that did start more than a thousand jobs (one per variant). A couple timeout errors later, all jobs finished and all variants are now generated. queue.log is chockfull of all the variants generation, no errors are logged.

But if I hear you correctly, that's not how it is supposed to work. And saving a global still doesn't kick off anything. CLI commands neither.

If I edit a volume and save it though, it does generate a single queue job for that volume.

So to sum it up:

  • saving a global does not trigger anything, no errors logged
  • CLI command does not create all variants, no errors logged
  • updating assets via CP does trigger one job per variant (thousands of jobs)
  • editing and saving a volume does the correct thing, one job for the volume

Craft 4.0.3 / Plugin beta 3

@JeanLucEsser
Copy link
Author

FWIW, this does not seem to be related to Sharp, I tried switching to CraftTransforms and the same applies. Volumes are still in a S3 Bucket though, only the volume dedicated to transforms is local.

@JeanLucEsser
Copy link
Author

Just to follow up on this.

I don't care if updating asset indexes does trigger one job per variant, unless if you say it shouldn't. As long as we're using async queue, it's a non blocking issue (when it'll work as async queue has its own issues right now ; see ostark/craft-async-queue#55).

The CLI commands not working is troubling but maybe I need to investigate some more, could be on my end. Same for updating via saving a global.

For now I managed to regenerate all variants, and I'll use async queue when the issue gets resolved.

Anyway, tell me how I can help you with this should you need it.

@khalwat
Copy link
Contributor

khalwat commented May 26, 2022

Will be in touch as I investigate it.

khalwat added a commit that referenced this issue Jun 27, 2022
@khalwat
Copy link
Contributor

khalwat commented Jun 27, 2022

Addressed in: ef806e7

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-imageoptimize": "dev-develop-v4 as 4.0.0-beta.4”,

Then do a composer clear-cache && composer update

@khalwat khalwat closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants