]> source.dussan.org Git - nextcloud-server.git/commit
Catch duplicate insertion errors while scanning files
authorVincent Petry <pvince81@owncloud.com>
Mon, 21 Oct 2013 12:48:08 +0000 (14:48 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 23 Oct 2013 11:00:46 +0000 (13:00 +0200)
commita542c57a7b6fc2c85887d11c16575ecc3d64fa3d
treec4c6f172580398c45bbe456e12356375b6048160
parent2d14daf36bf6c808e55895c78b42144942b73246
Catch duplicate insertion errors while scanning files

When two scanning processed run at the same time, for example when
scan.php and list.php were called at the same time on an external
storage mountpoint, duplicate insertion errors can occurs.

These errors are now logged and ignored.

Since both scans are running in parallel transactions, they don't see
each other's changes directly in the DB which can cause duplicate
insertion errors for mime types as well, but those mime types can't be
selected yet. The solution to this is to force-reload the mimetypes list
after the transaction is finished.

Fixes #5199
lib/private/files/cache/cache.php
lib/private/files/cache/scanner.php