From 901f1d43e98f64de00ab53e65d32fe0426635a91 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 22 Feb 2019 09:49:01 +0100 Subject: [PATCH] Don't throw on UniqueConstraintViolationException since a written value is okay enough Signed-off-by: Joas Schilling --- lib/private/Collaboration/Resources/Manager.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/private/Collaboration/Resources/Manager.php b/lib/private/Collaboration/Resources/Manager.php index 0555be5d7a..0d85db324b 100644 --- a/lib/private/Collaboration/Resources/Manager.php +++ b/lib/private/Collaboration/Resources/Manager.php @@ -406,7 +406,10 @@ class Manager implements IManager { 'resource_id' => $query->createNamedParameter($resource->getId()), 'access' => $query->createNamedParameter($access), ]); - $query->execute(); + try { + $query->execute(); + } catch (UniqueConstraintViolationException $e) { + } } public function cacheAccessForCollection(ICollection $collection, ?IUser $user, bool $access): void { @@ -419,7 +422,10 @@ class Manager implements IManager { 'collection_id' => $query->createNamedParameter($collection->getId()), 'access' => $query->createNamedParameter($access), ]); - $query->execute(); + try { + $query->execute(); + } catch (UniqueConstraintViolationException $e) { + } } public function invalidateAccessCacheForUser(?IUser $user): void {