-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Use index to mark parent as outdated, fixes: #14537 #14571
Use index to mark parent as outdated, fixes: #14537 #14571
Conversation
d471d2d
to
0f41197
Compare
0f41197
to
2ab0bb7
Compare
You're missing the comparison on Also it would be nice to move this over the using the query builder |
Wow that went a little to fast 😄 |
2ab0bb7
to
ef5ebd6
Compare
@icewind1991 Doesn't look like querybuilder works with UPDATE and INNER JOIN: https://stackoverflow.com/questions/15293502/doctrine-query-builder-not-working-with-update-and-inner-join |
@icewind1991 Actually, UPDATE with JOINS is not supported in sqlite. Cleanest way would probably be to do it in two queries then. What do you think? |
ef5ebd6
to
ab8b977
Compare
@icewind1991 Alright, now it uses two queries. I moved the reconnect logic to the storageIds query instead. I don't think we need both. I also couldn't figure out how reuse them as prepared statements. Is this okay? |
ab8b977
to
835d023
Compare
@kesselb @icewind1991 How does it look now? One thing in my case where a subfolder is not accessible/listable and hidden on the share for the SMB user. The notify changes are still listed by the SMB server even though the user listening do not have access (I think only NTFS permissions is set). Each time that subfolder is changed, this code will log about missing parent. Probably only a problem for a very few. |
835d023
to
b7e2594
Compare
looks good otherwise |
37bbb34
to
c0dc0ee
Compare
c0dc0ee
to
4aa30cd
Compare
$storageIds = $this->getStorageIds($mountId); | ||
} | ||
|
||
if (!$storageIds || count($storageIds) === 0) { |
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.
I would expect that getStorageIds always returns an array $storageIds === []
should work.
} catch (DriverException $ex) { | ||
$this->logger->logException($ex, ['app' => 'files_external', 'message' => 'Error while trying to mark folder as outdated', 'level' => ILogger::WARN]); | ||
$this->logger->logException($ex, ['app' => 'files_external', 'message' => 'Error while trying to find correct storage ids.', 'level' => ILogger::WARN]); |
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.
The logger should set the right app here. Could you test it without 'app' => 'files_external'
?
4aa30cd
to
575de52
Compare
@kesselb Thank you for you input. I have pushed changes now. Care to have a look again? |
Signed-off-by: Ari Selseng <ari@selseng.net>
575de52
to
11b3fbf
Compare
Don't have a working test setup for smb 😞 Code looks good 👍 |
@MorrisJobke @rullzer is this mergeable? |
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 looks good 👍
Make inner join to make at least mariadb to use index in update query in Notify.php
Fixes #14537