summaryrefslogtreecommitdiffstats
path: root/lib/private/Lock
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-04-13 10:05:11 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-04-14 11:32:34 +0200
commit7b3191705c27c43e62c4459d0ce1f923fd5c2d8e (patch)
tree55590398e18f21ecb12fa2b07072e45c21b9ee44 /lib/private/Lock
parent68746e1bdbaa9ea5345ea9065566f720f425f68a (diff)
downloadnextcloud-server-7b3191705c27c43e62c4459d0ce1f923fd5c2d8e.tar.gz
nextcloud-server-7b3191705c27c43e62c4459d0ce1f923fd5c2d8e.zip
Let the querybuilder convert
Diffstat (limited to 'lib/private/Lock')
-rw-r--r--lib/private/Lock/DBLockingProvider.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php
index 1865e94925f..3a599a61e7d 100644
--- a/lib/private/Lock/DBLockingProvider.php
+++ b/lib/private/Lock/DBLockingProvider.php
@@ -26,6 +26,7 @@ namespace OC\Lock;
use OC\DB\QueryBuilder\Literal;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\ILogger;
use OCP\Lock\ILockingProvider;
@@ -267,13 +268,10 @@ class DBLockingProvider extends AbstractLockingProvider {
foreach ($chunkedPaths as $chunk) {
$builder = $this->connection->getQueryBuilder();
- $params = array_map(function ($path) use ($builder) {
- return $builder->createNamedParameter($path);
- }, $chunk);
$query = $builder->update('file_locks')
->set('lock', $builder->createFunction('`lock` -1'))
- ->where($builder->expr()->in('key', $params))
+ ->where($builder->expr()->in('key', $builder->createNamedParameter($chunk, IQueryBuilder::PARAM_STR_ARRAY)))
->andWhere($builder->expr()->gt('lock', new Literal(0)));
$query->execute();