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

Fix statcache in FileCache #20304

Merged
merged 3 commits into from
Dec 30, 2024
Merged

Fix statcache in FileCache #20304

merged 3 commits into from
Dec 30, 2024

Conversation

rob006
Copy link
Contributor

@rob006 rob006 commented Dec 30, 2024

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #20300

fix #20300

Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 64.83%. Comparing base (b4efeb3) to head (86ba715).

Files with missing lines Patch % Lines
framework/caching/FileCache.php 75.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@samdark samdark merged commit a8586fc into yiisoft:master Dec 30, 2024
@samdark
Copy link
Member

samdark commented Dec 30, 2024

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();
Copy link
Member

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?

Copy link
Contributor Author

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.

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.

Resetting after fileCache expires cannot immediately obtain values
3 participants