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

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


The following commit(s) were added to refs/heads/main by this push:
     new cb43b1b  feat(algolia): change data update sync to async
cb43b1b is described below

commit cb43b1b4cde601021acd2d486b50213992ee6ac4
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