This is an automated email from the ASF dual-hosted git repository.

kumfo pushed a commit to branch feat/algolia
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit b402bf13899ef08f6d600ba9a4337ea6763332e0
Author: kumfo <[email protected]>
AuthorDate: Wed Oct 23 09:41:10 2024 +0800

    feat(algolia): change data update sync to async
---
 search-algolia/algolia.go | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/search-algolia/algolia.go b/search-algolia/algolia.go
index 230ac89..b810d66 100644
--- a/search-algolia/algolia.go
+++ b/search-algolia/algolia.go
@@ -247,21 +247,13 @@ func (s *SearchAlgolia) SearchAnswers(ctx 
context.Context, cond *plugin.SearchBa
 
 // UpdateContent updates the content to algolia server
 func (s *SearchAlgolia) UpdateContent(ctx context.Context, content 
*plugin.SearchContent) (err error) {
-       res, err := s.getIndex("").SaveObject(content)
-       if err != nil {
-               return
-       }
-       err = res.Wait()
+       _, err = s.getIndex("").SaveObject(content)
        return
 }
 
 // DeleteContent deletes the content
 func (s *SearchAlgolia) DeleteContent(ctx context.Context, contentID string) 
(err error) {
-       res, err := s.getIndex("").DeleteObject(contentID)
-       if err != nil {
-               return err
-       }
-       err = res.Wait()
+       _, err = s.getIndex("").DeleteObject(contentID)
        return
 }
 

Reply via email to