-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Open some events for external subscription #547
Comments
Hi @Skrypt , There's a similar problem here, right? An index action may be performed multiple times on the same document when updating a piece of content. |
Good question. Normally it should not. I never saw this execute twice yet. Maybe something has changed. If we index multiple times then it is a strong performance issue. |
Yes, it's true that it hasn't been updated twice so far, because Yessql's SaveAsync just adds the object to the pending collection. I've been looking at Yessql's code over and over again, and I think it's worth opening up some of the functionality to customisation. If I want to add some custom actions before executing the Add, Delete, and Update commands to the database, what should I do? |
Currently we have some events open in OC, but those are not enough, some events may be an intermediate process,
for example, we get an object and try UpdateAsync first, the object state is then saved to the state manager.
Then call some validation function ValidateAsync in OC
Then publish it
https://github.com/OrchardCMS/OrchardCore/blob/dcf83bca479ad06eeb41b9a09292a67fa26a2b21/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs#L59-L120
We cannot tell if a Save is the last one to be committed to the database
So my suggestion is to expose some events externally through YesSql's series of IIndexCmmand types
Used to notify external programs that the object has been committed to the database,
You can perform subsequent operations
For example, update the Lucene index and create a custom index table (this is what I am working on 😅 )
The text was updated successfully, but these errors were encountered: