-
-
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
Repair step to clear frontend related caches #8144
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8144 +/- ##
=============================================
- Coverage 51.73% 35.07% -16.67%
- Complexity 25357 25362 +5
=============================================
Files 1598 1599 +1
Lines 95021 95057 +36
Branches 1376 1376
=============================================
- Hits 49160 33339 -15821
- Misses 45861 61718 +15857
|
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.
Code makes sense! 👍
$output->info('Image cache cleared'); | ||
|
||
$this->scssCacher->resetCache(); | ||
$c = $this->cacheFactory->createDistributed('SCSS'); |
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.
Wouldn't it make more sense to do this in the scssCacher? I would expect if I call the reset cache function that also the Memorycache is cleared.
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.
Ah yes. Just moved that over and added tests for those methods as well.
$output->info('SCSS cache cleared'); | ||
|
||
$this->jsCombiner->resetCache(); | ||
$c = $this->cacheFactory->createDistributed('JS'); |
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.
same here
b2bfce2
to
5ad3a39
Compare
lib/private/Template/JSCombiner.php
Outdated
public function resetCache() { | ||
$this->depsCache->clear(); | ||
$appDirectory = $this->appData->getDirectoryListing(); | ||
if(empty($appDirectory)){ |
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.
Not really needed if you just loop over the array in the next step. But doesn't hurt.
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.
Ok, removed them as well.
Can you rebase upon master? Now that my fix is in. I just want green CI to be sure. |
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
5ad3a39
to
b87e5a0
Compare
Rebased. |
Signed-off-by: Roeland Jago Douma <[email protected]>
Failure is unrelated. |
This PR adds a repair step that will be executed during update and when calling occ maintenance:repair, that will remove any frontend related caches that caused issues in the past, as:
I also added some further logging to the SCSSCacher and the JSCombiner, so at least logs can tell if something was wrong there.
The initial idea was from #7984 to pregenerate files, but that would be a lot more logic to be implemented, since the list of js/css files is built dynamically on every request. Clearing those files from appdata should be enough there.