putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
147 stars 35 forks source link

CLI commands do not show up in Craft queue #650

Closed justenh closed 3 months ago

justenh commented 3 months ago

Support Request

Our deploy script triggers /blitz/cache/generate-site 1 & /blitz/cache/deploy, but we've noticed that the command does not trigger a job to display in the queue manager. Are we correct in assuming that Blitz could potentially be running multiple generators If an admin were to also make a change via the CMS during this time, triggering a "Generating Cache" job?

Plugin Version

4.14.0

bencroker commented 3 months ago

By default, both the /blitz/cache/generate-site and /blitz/cache/deploy commands run in the console. It is possible to force a command to queue a job instead of run it directly by adding --queue=1, see https://putyourlightson.com/plugins/blitz#console-commands.

What you describe seems possible, assuming you’ve selected a refresh mode that generates the cache in a queue job.

justenh commented 3 months ago

@bencroker This is perfect! Thanks for pointing that out.

We've updated our script to

php craft blitz/cache/generate-site -1 --queue=1
php craft blitz/cache/deploy --queue=1

and everything seems to be moving along well.

bencroker commented 3 months ago

Glad to hear it!