-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add named metadata event #41601
add named metadata event #41601
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it would require a check condition on every Live/Background listeners
no, this is purely optionnal; only if they want to called via a specific occ command. |
So the passed name does not need to match a metadata name, it’s like a tag used by some providers? |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
f9ec06b
to
22d6c8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
MetadataNameEvent
will usegetName()
to confirm the event is related to itself and manage the refresh of metadata the same way it would manage theLive
and/orBackground
Event.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.