From f497d8b6e5a42635ec181dfeda404862ee4c8e3d Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 7 Nov 2023 12:43:01 -0100 Subject: IFilesMetadata Signed-off-by: Maxence Lange --- lib/private/FilesMetadata/Listener/MetadataDelete.php | 3 +++ lib/private/FilesMetadata/Listener/MetadataUpdate.php | 3 +++ 2 files changed, 6 insertions(+) (limited to 'lib/private/FilesMetadata/Listener') diff --git a/lib/private/FilesMetadata/Listener/MetadataDelete.php b/lib/private/FilesMetadata/Listener/MetadataDelete.php index 7f8fd035735..25c944475a9 100644 --- a/lib/private/FilesMetadata/Listener/MetadataDelete.php +++ b/lib/private/FilesMetadata/Listener/MetadataDelete.php @@ -30,6 +30,7 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Files\Events\Node\NodeDeletedEvent; use OCP\FilesMetadata\IFilesMetadataManager; +use Psr\Log\LoggerInterface; /** * Handle file deletion event and remove stored metadata related to the deleted file @@ -39,6 +40,7 @@ use OCP\FilesMetadata\IFilesMetadataManager; class MetadataDelete implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, + private LoggerInterface $logger ) { } @@ -56,6 +58,7 @@ class MetadataDelete implements IEventListener { $this->filesMetadataManager->deleteMetadata($nodeId); } } catch (Exception $e) { + $this->logger->warning('issue while running MetadataDelete', ['exception' => $e]); } } } diff --git a/lib/private/FilesMetadata/Listener/MetadataUpdate.php b/lib/private/FilesMetadata/Listener/MetadataUpdate.php index 64c8bb474b1..395a852e9e3 100644 --- a/lib/private/FilesMetadata/Listener/MetadataUpdate.php +++ b/lib/private/FilesMetadata/Listener/MetadataUpdate.php @@ -31,6 +31,7 @@ use OCP\EventDispatcher\IEventListener; use OCP\Files\Events\Node\NodeCreatedEvent; use OCP\Files\Events\Node\NodeWrittenEvent; use OCP\FilesMetadata\IFilesMetadataManager; +use Psr\Log\LoggerInterface; /** * Handle file creation/modification events and initiate a new event related to the created/edited file. @@ -42,6 +43,7 @@ use OCP\FilesMetadata\IFilesMetadataManager; class MetadataUpdate implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, + private LoggerInterface $logger ) { } @@ -56,6 +58,7 @@ class MetadataUpdate implements IEventListener { try { $this->filesMetadataManager->refreshMetadata($event->getNode()); } catch (Exception $e) { + $this->logger->warning('issue while running MetadataUpdate', ['exception' => $e]); } } } -- cgit v1.2.3