Uh oh!
There was an error while loading. Please reload this page.
add named metadata event - #41601
Conversation
artonge
commented
Nov 20, 2023
So existing providers need to all listen to this new event? |
| if ((self::PROCESS_LIVE & $process) !== 0) { | ||
| $event = new MetadataLiveEvent($node, $metadata); | ||
| } elseif ((self::PROCESS_NAMED & $process) !== 0 && $namedEvent !== '') { | ||
| $event = new MetadataNamedEvent($node, $metadata, $namedEvent); |
There was a problem hiding this comment.
So named event is always live, or always backgrounded?
Why the name is not an optional parameter for both MetadataLiveEvent and MetadataBackgroundEvent?
There was a problem hiding this comment.
Because it would require a check condition on every Live/Background listeners
ArtificialOwl
commented
Nov 20, 2023
no, this is purely optionnal; only if they want to called via a specific occ command. |
come-nc
commented
Nov 20, 2023
So the passed name does not need to match a metadata name, it’s like a tag used by some providers? |
ArtificialOwl
commented
Nov 20, 2023
yes, as we don't communicate via provider we cannot enforce provider_id |
The idea behind this is mostly to remove the custom files scan from files_fulltextsearch and use metadata to store the status of the index of a document there. However, starting a full index of your current document will also trigger some heavy process from the extraction of metadata from photos. Using NamedEvent, I can trigger a scan of files to only update metadata related to fulltextsearch |
come-nc
left a comment
There was a problem hiding this comment.
I get the idea, I’m not entirely sure this won’t be cause for trouble.
Especially there is nothing to prevent name clash between applications.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
f9ec06b to
22d6c8dCompare
artonge
left a comment
There was a problem hiding this comment.
Feels highly specific, but I do not see any other solution.
This adds:
MetadataNamedEvent,occ files:scan --generate-metadata [name]command.The idea is to provide a last param to the
IFilesMetadataManager::refreshMetadata()that assign a name to the event.Any app listening to the
MetadataNameEventwill usegetName()to confirm the event is related to itself and manage the refresh of metadata the same way it would manage theLiveand/orBackgroundEvent.This way, we can ask a refresh of the metadata from all files' from the cloud without loosing time refreshing all metadata provided by all apps.