Make LargeFileHelper.php faster by avoiding execs as much as possible#9490
Merged
rullzer merged 1 commit intonextcloud:masterfrom May 18, 2018
Merged
Conversation
Member
|
@marco44 Could you add a |
juliusknorr
reviewed
May 17, 2018
lib/private/LargeFileHelper.php
Outdated
| if (strpos($os, 'linux') !== false) { | ||
| return $this->exec('stat -c %Y ' . escapeshellarg($fullPath)); | ||
| try { | ||
| $result= filemtime($fullPath); |
Member
There was a problem hiding this comment.
Can you adjust the code style here so we have a space between the variable name and the =?
juliusknorr
reviewed
May 17, 2018
lib/private/LargeFileHelper.php
Outdated
| try { | ||
| $result= filemtime($fullPath); | ||
| } catch (\Exception $e) { | ||
| $result=-1; |
juliusknorr
reviewed
May 17, 2018
lib/private/LargeFileHelper.php
Outdated
| return (float) sprintf('%u', $result); | ||
| } | ||
| return $result; | ||
| return $result; |
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
|
Contributor
Author
|
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
Member
|
Best to be reviewed in the whitespace cleaned diff: https://github.com/nextcloud/server/pull/9490/files?w=1 |
juliusknorr
approved these changes
May 18, 2018
Member
|
CI failure seems unrelated |
Member
Correct. I would still like to have feedback from @icewind1991 on this one. |
Member
|
Backport in #9656 @icewind1991 I guess this backport makes sense, right? |
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.
Should fix #8405, as per dissussed in the issue