diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-11-07 12:43:01 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2023-11-07 12:43:08 -0100 |
commit | f497d8b6e5a42635ec181dfeda404862ee4c8e3d (patch) | |
tree | e6cd926b6f7ab4d9762f0312ad8962c78aaf1309 /lib/private/FilesMetadata/Listener | |
parent | e62e9e3dbf1a2573554b1a9eabbf5b59b652dae6 (diff) | |
download | nextcloud-server-f497d8b6e5a42635ec181dfeda404862ee4c8e3d.tar.gz nextcloud-server-f497d8b6e5a42635ec181dfeda404862ee4c8e3d.zip |
IFilesMetadata
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/private/FilesMetadata/Listener')
-rw-r--r-- | lib/private/FilesMetadata/Listener/MetadataDelete.php | 3 | ||||
-rw-r--r-- | lib/private/FilesMetadata/Listener/MetadataUpdate.php | 3 |
2 files changed, 6 insertions, 0 deletions
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]); } } } |