File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ def insert(self, string_or_strings):
227227 return loop .run_until_complete (self .ainsert (string_or_strings ))
228228
229229 async def ainsert (self , string_or_strings ):
230+ update_storage = False
230231 try :
231232 if isinstance (string_or_strings , str ):
232233 string_or_strings = [string_or_strings ]
@@ -240,6 +241,7 @@ async def ainsert(self, string_or_strings):
240241 if not len (new_docs ):
241242 logger .warning ("All docs are already in the storage" )
242243 return
244+ update_storage = True
243245 logger .info (f"[New Docs] inserting { len (new_docs )} docs" )
244246
245247 inserting_chunks = {}
@@ -286,7 +288,8 @@ async def ainsert(self, string_or_strings):
286288 await self .full_docs .upsert (new_docs )
287289 await self .text_chunks .upsert (inserting_chunks )
288290 finally :
289- await self ._insert_done ()
291+ if update_storage :
292+ await self ._insert_done ()
290293
291294 async def _insert_done (self ):
292295 tasks = []
You can’t perform that action at this time.
0 commit comments