@@ -210,7 +210,7 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData =
210210 * @var \OC\Files\Cache\CacheEntry $cacheData
211211 */
212212 $ newData = $ this ->array_diff_assoc_multi ($ data , $ cacheData ->getData ());
213-
213+
214214 // make it known to the caller that etag has been changed and needs propagation
215215 if (isset ($ newData ['etag ' ])) {
216216 $ data ['etag_changed ' ] = true ;
@@ -312,6 +312,7 @@ public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $loc
312312 }
313313
314314 if ($ lock && $ this ->storage ->instanceOfStorage (ILockingStorage::class)) {
315+ $ this ->storage ->acquireLock ('scanner:: ' . $ path , ILockingProvider::LOCK_EXCLUSIVE , $ this ->lockingProvider );
315316 $ this ->storage ->acquireLock ('scanner:: ' . $ path , ILockingProvider::LOCK_EXCLUSIVE , $ this ->lockingProvider );
316317 $ this ->storage ->acquireLock ($ path , ILockingProvider::LOCK_SHARED , $ this ->lockingProvider );
317318 }
@@ -351,23 +352,23 @@ public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $loc
351352 *
352353 */
353354 protected function array_diff_assoc_multi (array $ array1 , array $ array2 ) {
354-
355+
355356 $ result = [];
356357
357358 foreach ($ array1 as $ key => $ value ) {
358-
359+
359360 // if $array2 doesn't have the same key, that's a result
360361 if (!array_key_exists ($ key , $ array2 )) {
361362 $ result [$ key ] = $ value ;
362363 continue ;
363364 }
364-
365+
365366 // if $array2's value for the same key is different, that's a result
366367 if ($ array2 [$ key ] !== $ value && !is_array ($ value )) {
367368 $ result [$ key ] = $ value ;
368369 continue ;
369370 }
370-
371+
371372 if (is_array ($ value )) {
372373 $ nestedDiff = $ this ->array_diff_assoc_multi ($ value , $ array2 [$ key ]);
373374 if (!empty ($ nestedDiff )) {
0 commit comments