-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Make LargeFileHelper.php faster by avoiding execs as much as possible #9490
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
Make LargeFileHelper.php faster by avoiding execs as much as possible #9490
Conversation
MorrisJobke
left a comment
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 👍
|
@marco44 Could you add a |
lib/private/LargeFileHelper.php
Outdated
| if (strpos($os, 'linux') !== false) { | ||
| return $this->exec('stat -c %Y ' . escapeshellarg($fullPath)); | ||
| try { | ||
| $result= filemtime($fullPath); |
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.
Can you adjust the code style here so we have a space between the variable name and the =?
lib/private/LargeFileHelper.php
Outdated
| try { | ||
| $result= filemtime($fullPath); | ||
| } catch (\Exception $e) { | ||
| $result=-1; |
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.
lib/private/LargeFileHelper.php
Outdated
| return (float) sprintf('%u', $result); | ||
| } | ||
| return $result; | ||
| return $result; |
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.
1 space is enough. 😉
ca84a16 to
5926218
Compare
Codecov Report
@@ Coverage Diff @@
## master #9490 +/- ##
============================================
- Coverage 51.12% 6.67% -44.46%
- Complexity 25724 25726 +2
============================================
Files 1574 1641 +67
Lines 88510 96457 +7947
Branches 0 1393 +1393
============================================
- Hits 45252 6436 -38816
- Misses 43258 90021 +46763
|
|
Corrected all your remarks and amended the commit so the signed-off is there |
Signed-off-by: Marc Cousin <cousinmarc@gmail.com>
5926218 to
32fd091
Compare
|
Best to be reviewed in the whitespace cleaned diff: https://github.com/nextcloud/server/pull/9490/files?w=1 |
|
CI failure seems unrelated |
Correct. I would still like to have feedback from @icewind1991 on this one. |
icewind1991
left a comment
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.
Looks fine
|
Backport in #9656 @icewind1991 I guess this backport makes sense, right? |
Should fix #8405, as per dissussed in the issue