Merged
Conversation
Improvement of FreshRSS#4422 The main problem was due to `touch()` not automatically clearing the file status cache, and requiring a call to `clearstatcache()`. Example: ``` php > touch('/tmp/touch.txt'); php > echo date('c', filemtime('/tmp/touch.txt')); 2023-08-03T17:27:43+02:00 php > touch('/tmp/touch.txt'); php > echo date('c', filemtime('/tmp/touch.txt')); 2023-08-03T17:27:43+02:00 php > clearstatcache(true, '/tmp/touch.txt'); php > echo date('c', filemtime('/tmp/touch.txt')); 2023-08-03T17:28:21+02:00 ```
Frenzie
approved these changes
Aug 3, 2023
| if ($simplePiePush === null && $feed_id === 0 && (time() <= $feed->lastUpdate() + $ttl)) { | ||
| //Too early to refresh from source, but check whether the feed was updated by another user | ||
| if ($mtime <= 0 || $feed->lastUpdate() >= $mtime) { | ||
| $ε = 10; // negligible offset errors in seconds |
Contributor
There was a problem hiding this comment.
Suggested change
| $ε = 10; // negligible offset errors in seconds | |
| $errorInSeconds = 10; // negligible offset errors in seconds |
it's more explicit
Member
Author
There was a problem hiding this comment.
It is not a fixed error, it is a negligible offset, commonly called epsilon :-)
| $ε = 10; // negligible offset errors in seconds | ||
| if ($mtime <= 0 || | ||
| $feed->lastUpdate() + $ε >= $mtime || | ||
| time() + $ε >= $mtime + FreshRSS_Context::$system_conf->limits['cache_duration']) { // is cache still valid? |
Contributor
There was a problem hiding this comment.
Suggested change
| time() + $ε >= $mtime + FreshRSS_Context::$system_conf->limits['cache_duration']) { // is cache still valid? | |
| time() + $errorInSeconds >= $mtime + FreshRSS_Context::$system_conf->limits['cache_duration']) { // is cache still valid? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improvement of #4422
The main problem was due to
touch()not automatically clearing the file status cache, and requiring a call toclearstatcache(). Example: