aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Lock
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-11-12 17:43:56 +0100
committerGitHub <noreply@github.com>2018-11-12 17:43:56 +0100
commitfd8eeccb15e1219a2d18fc421e741c315737c55e (patch)
tree55b56592cf40ab4fcc605e45a95d13d79806eb91 /lib/private/Lock
parent9e1ec0cf46055dbf08a139124d292eb38b8aebd2 (diff)
parentbb352fb667e87ea0829f1da5f9e85c34bdefe9fa (diff)
downloadnextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.tar.gz
nextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.zip
Merge pull request #11942 from nextcloud/techdebt/noid/use-count-function
Use the defined func()->count() instead of manual counting
Diffstat (limited to 'lib/private/Lock')
-rw-r--r--lib/private/Lock/DBLockingProvider.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php
index 79f2ff274cf..6d9c8f1b3d1 100644
--- a/lib/private/Lock/DBLockingProvider.php
+++ b/lib/private/Lock/DBLockingProvider.php
@@ -314,7 +314,7 @@ class DBLockingProvider extends AbstractLockingProvider {
$builder = $this->connection->getQueryBuilder();
$query = $builder->update('file_locks')
- ->set('lock', $builder->createFunction('`lock` -1'))
+ ->set('lock', $builder->func()->subtract('lock', $builder->expr()->literal(1)))
->where($builder->expr()->in('key', $builder->createNamedParameter($chunk, IQueryBuilder::PARAM_STR_ARRAY)))
->andWhere($builder->expr()->gt('lock', new Literal(0)));