Skip to content

Add a --queue flag to static:warm command - #5272

Merged
jasonvarga merged 24 commits into
statamic:masterfrom
arthurperton:pr/static-warm-queue
Feb 28, 2022
Merged

Add a --queue flag to static:warm command#5272
jasonvarga merged 24 commits into
statamic:masterfrom
arthurperton:pr/static-warm-queue

Conversation

@arthurperton

Copy link
Copy Markdown
Contributor

An implementation of idea #750.

This also adds some tests for the static warm command. They are in no way exhaustive, but it is a (good) start.

@arthurperton

Copy link
Copy Markdown
Contributor Author

All tests succeeding locally. Must be a version thing...

@arthurperton

Copy link
Copy Markdown
Contributor Author

Nah this is no good. I’ll revert the changes later on and target the master branch, which (now) uses high enough versions of Laravel, Guzzle and PHP in its CI.

@arthurperton
arthurperton changed the base branch from 3.2 to master February 19, 2022 07:22
@arthurperton

Copy link
Copy Markdown
Contributor Author

Well it's passing at least 😅

@arthurperton
arthurperton marked this pull request as ready for review February 21, 2022 15:48
@jasonvarga
jasonvarga merged commit 839a335 into statamic:master Feb 28, 2022
@arthurperton
arthurperton deleted the pr/static-warm-queue branch February 28, 2022 16:44
@jelleroorda

Copy link
Copy Markdown
Contributor

Thanks Arthur! I’m wondering though, wouldn’t queueing the warming now implicitly disable the concurrency setting?

Maybe we could retain that by instead queueing the warming with just a single warming job, that still uses a pool like when not queueing?

@jelleroorda

Copy link
Copy Markdown
Contributor

FYI: the goal of the concurrency setting was to lower the amount of simultaneous request when warming the static cache. This eases the load on smaller servers, and prevents the warming from having a lot of requests fail (for example with 504s).

My fear is that simply queueing the jobs will overload the smaller servers again, I’d love to queue my static warming in my deploy scripts though.

@jasonvarga

Copy link
Copy Markdown
Member

That sounds correct. If you want to leverage concurrency, don't use the queue option.

Another option might be to specify which queue you want to use, and then you can customize it in your config/queue.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants