-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Fix warming up routes #57554
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
Conversation
6a13d21
to
c95bd32
Compare
c95bd32
to
cc918e9
Compare
@@ -84,14 +84,12 @@ public function getRouteCollection(): RouteCollection | |||
|
|||
public function warmUp(string $cacheDir, ?string $buildDir = null): array | |||
{ | |||
if (!$buildDir) { | |||
return []; | |||
if (null === $currentDir = $this->getOption('cache_dir')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the CacheWarmer not registered when the caching is disabled for the router ?
And with this change, the Router cache is generated once at build-time and once again if you run cache:warmup
, right ?
If you run cache:warmup
right after your deploy (thus, on a read-only buildDir), this will either fail or you regenerate the router cache in the cache_dir, which won't be used at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no it's not disabled if you set the router.cache_dir to null (which is the only way since the deprecation of the config option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you run cache:warmup right after your deploy (thus, on a read-only buildDir), this will either fail or you regenerate the router cache in the cache_dir, which won't be used at all.
then, $buildDir will be null so that RouterCacheWarmer won't call this warmup method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then, $buildDir will be null so that RouterCacheWarmer won't call this warmup method
Ah right, I got caught by the double warming layer of the Router... 👍
Follows #52962 and builds on the semantics of #57553.