-
Notifications
You must be signed in to change notification settings - Fork 58
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
Avoid folder processing on pre-generate #73
Conversation
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
=========================================
+ Coverage 5% 5.2% +0.2%
- Complexity 62 63 +1
=========================================
Files 6 6
Lines 260 250 -10
=========================================
Hits 13 13
+ Misses 247 237 -10
Continue to review full report at Codecov.
|
I am not too good in PHP coding to understand everything, but first I though But as I see now, it really just seems to process all files inside the folder. So if your assumption is write, that by adding a folder with files inside, the watcher also reacts on each included file, this PR makes totally sense. Should be easy to find out by adding some test folder+pictures inside and run |
Hi @MichaIng! Is there any chance of reviewing this PR? A lot of people will benefit from this. A the moment pre-generate scans all the folders and people with small instances (like Raspberry PI's). |
I just tested to add a folder with two images inside and ran
So I can confirm, that your assumptions for the PR are right and will add and test the PR tomorrow. |
I just applied the PR to my app, removed the test folder, recreated it again and ran pre-generate:
Previews for both files were generated and they were just touched once for this 👍 ! Vote 4 merging this PR! This shows by the way that previews were removed together with the files, as expected. This was also doubted here and there on help.nextcloud.com 😉. €: I just published the PR on the forum and hope for some more testers and attention from the devs by this: @https://help.nextcloud.com/t/more-efficient-pre-generation-github-pull-request/21475 |
@seik nice stuff. I was thinking about something similar this week as I saw the table getting pretty full at my own server. Lets get this in! |
Released in 1.0.7! Thnx again :D |
This in theory fixes #62.
When you upload a file (or a folder) the folder/s and the files are added to the db, so if I'm not missing something there is no need to process folders.
Furthermore related with #62, on my end I could find that the duplicate folder was the root user folder ex:
/data/exampleuser/
(I can't really say why the root folder was passed to thepostWrite()
method on Watcher.php) so as you can imagine theprocessFolder()
method tried to scan the entire user folder multiple times.