-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Cache fetched apps in update check #7264
Conversation
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.
Static.... ⚱️
Actually it should be cached already? server/lib/private/App/AppStore/Fetcher/Fetcher.php Lines 143 to 153 in 2eb2b6e
|
Ah reading helps... |
Static fun |
And I have no idea what this is :/ |
Ah - because it is cached and not cleared between those jobs :/ |
Codecov Report
@@ Coverage Diff @@
## master #7264 +/- ##
============================================
+ Coverage 50.85% 50.88% +0.02%
- Complexity 24551 24552 +1
============================================
Files 1585 1585
Lines 93833 93791 -42
Branches 1354 1354
============================================
+ Hits 47719 47725 +6
+ Misses 46114 46066 -48
|
Okay ... I needed to take a bigger reordering of how it works. basically the second commit in here brings the DI version to all places where the Installer is used. And the third commit replaced the static calls to @nickvergessen @rullzer @LukasReschke Please review |
dbbd514
to
f0b70e7
Compare
f0b70e7
to
f9f4981
Compare
Several tests are failing, but on first sight they seem unrelated… but those happen not on master. |
f9f4981
to
bc8b02b
Compare
It was related. I forgot to mock the call in the tests, so it asked for actual updates in the appstore. 🙈 |
The code tried to find the apps with updates and thus was called for every available app. This caused to get the full appstore content as often as apps are available. The appstore request itself was cached nevertheless in an appdata dir, but with an object storage this is still a lot of round trips to read this cached result. Thus the instantiated list is now cached in a static variable (because it's a static method call). Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
bc8b02b
to
df61d43
Compare
return false; | ||
} | ||
|
||
$apps = $appFetcher->get(); | ||
if ($this->apps === null) { | ||
$apps = $this->appFetcher->get(); |
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.
Followup to #7264 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Followup to #7264 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
The code tried to find the apps with updates and thus was called for every available app. This caused to get the full appstore content as often as apps are available. The appstore request itself was cached nevertheless in an appdata dir, but with an object storage this is still a lot of round trips to read this cached result. Thus the instantiated list is now cached in a static variable (because it's a static method call).
Fixes #7235
Diff of the before and after code base: https://blackfire.io/profiles/compare/0b59e81d-4ea4-4a22-ba14-640cf091d487/graph