-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Cache in filecache #28166
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
Cache in filecache #28166
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
|
|
||
| namespace OCA\Files_Sharing\Command; | ||
|
|
||
| use OC\Files\Cache\Cache; | ||
| use OCP\DB\QueryBuilder\IQueryBuilder; | ||
| use OCP\IDBConnection; | ||
| use Symfony\Component\Console\Command\Command; | ||
|
|
@@ -129,6 +130,9 @@ public function deleteFiles ($numericId, OutputInterface $output) { | |
| ); | ||
| $output->write("deleting files for storage $numericId ... "); | ||
| $count = $queryBuilder->execute(); | ||
| if (Cache::$metaDataCache !== null) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear before executing the query |
||
| Cache::$metaDataCache->clear(); | ||
| } | ||
| $output->writeln("deleted $count"); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
|
|
||
| namespace OCA\Files_Sharing\Tests\Command; | ||
|
|
||
| use OC\Files\Cache\Cache; | ||
| use OCA\Files_Sharing\Command\CleanupRemoteStorages; | ||
| use Test\TestCase; | ||
|
|
||
|
|
@@ -101,6 +102,9 @@ protected function setup() { | |
| $filesQuery->setParameter(2, \md5('file' . $i)); | ||
| $filesQuery->execute(); | ||
| } | ||
| if (Cache::$metaDataCache !== null) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same (clear) |
||
| Cache::$metaDataCache->clear(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
|
|
||
| namespace OCA\Testing; | ||
|
|
||
| use OC\Files\Cache\Cache; | ||
| use OCP\IDBConnection; | ||
|
|
||
| /** | ||
|
|
@@ -53,6 +54,9 @@ public function increaseFileIDsBeyondMax32bits(){ | |
| '', '4', '3', '163', '1499256550', '1499256550', | ||
| '0', '0', '595cd6e63f375', '27', 'NULL')"; | ||
| $this->connection->executeQuery($query); | ||
| if (Cache::$metaDataCache !== null) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same (clear) |
||
| Cache::$metaDataCache->clear(); | ||
| } | ||
| } | ||
| return new \OC_OCS_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.
Clear metadata cache before executing the query.