diff options
author | raul <raul@nextcloud.com> | 2022-10-03 14:40:57 +0300 |
---|---|---|
committer | Raul Ferreira Fuentes (Rebase PR Action) <Raudius@users.noreply.github.com> | 2022-10-25 18:08:22 +0300 |
commit | bdbacdffc231c4dec65f7ea1809baeb697934c1a (patch) | |
tree | e01766a5b85993ab8e81993696738700eadac857 | |
parent | ba12309f3c6db5ced1941b3f3cc60a680df8390f (diff) |
Fix unencrypted size calculation for files created before the Encryption storage is enabled
Signed-off-by: raul <raul@nextcloud.com>
-rw-r--r-- | lib/private/Files/Cache/Propagator.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php index 0a4b23d5bd1..3fba8aaaed1 100644 --- a/lib/private/Files/Cache/Propagator.php +++ b/lib/private/Files/Cache/Propagator.php @@ -24,7 +24,6 @@ namespace OC\Files\Cache; -use OC\DB\QueryBuilder\QueryFunction; use Doctrine\DBAL\Exception\RetryableException; use OC\Files\Storage\Wrapper\Encryption; use OCP\DB\QueryBuilder\IQueryBuilder; @@ -122,7 +121,7 @@ class Propagator implements IPropagator { $unencryptedSizeColumn = $builder->getColumnName('unencrypted_size'); $newUnencryptedSize = $builder->func()->greatest( $builder->func()->add( - $builder->createFunction("CASE WHEN $hasUnencryptedSize THEN $sizeColumn ELSE $unencryptedSizeColumn END"), + $builder->createFunction("CASE WHEN $hasUnencryptedSize THEN $unencryptedSizeColumn ELSE $sizeColumn END"), $builder->createNamedParameter($sizeDifference) ), $builder->createNamedParameter(-1, IQueryBuilder::PARAM_INT) @@ -139,7 +138,7 @@ class Propagator implements IPropagator { break; } catch (RetryableException $e) { /** @var LoggerInterface $loggerInterface */ - $loggerInterface = \OCP\Server::get(LoggerInterface::class); + $loggerInterface = \OC::$server->get(LoggerInterface::class); $loggerInterface->warning('Retrying propagation query after retryable exception.', [ 'exception' => $e ]); } } |