-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fix statcache in FileCache #20304
Fix statcache in FileCache #20304
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20304 +/- ##
=========================================
Coverage 64.83% 64.83%
- Complexity 11417 11418 +1
=========================================
Files 431 431
Lines 37155 37158 +3
=========================================
+ Hits 24090 24092 +2
- Misses 13065 13066 +1 ☔ View full report in Codecov by Sentry. |
Thank you! |
@@ -155,7 +155,12 @@ protected function setValue($key, $value, $duration) | |||
$duration = 31536000; // 1 year | |||
} | |||
|
|||
return @touch($cacheFile, $duration + time()); | |||
if (@touch($cacheFile, $duration + time())) { | |||
clearstatcache(); |
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.
We've ported it Yii3 cache and while doing so, decided that it's better to clear cache for that file only via clearstatcache(false, $cacheFile)
. Does that make sense to you?
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.
Stat cache is stored only for one (last) file, so I don't think you need to specify file path here. It is only used if you want to clear realpath cache, which is no needed here. So I don't think these changes make any sense.
fix #20300