We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4f6a703 + 7e994f8 commit 42b8a19Copy full SHA for 42b8a19
1 file changed
weaviate/collections/batch/base.py
@@ -1,3 +1,5 @@
1
+import contextvars
2
+import functools
3
import math
4
import os
5
import threading
@@ -324,11 +326,15 @@ def __batch_send(self) -> None:
324
326
uuid_lookup=self.__uuid_lookup,
325
327
)
328
# do not block the thread - the results are written to a central (locked) list and we want to have multiple concurrent batch-requests
329
+ ctx = contextvars.copy_context()
330
self.__executor.submit(
- self.__send_batch,
- objs,
- refs,
331
- readd_rate_limit=isinstance(self.__batching_mode, _RateLimitedBatching),
+ ctx.run,
332
+ functools.partial(
333
+ self.__send_batch,
334
+ objs,
335
+ refs,
336
+ readd_rate_limit=isinstance(self.__batching_mode, _RateLimitedBatching),
337
+ ),
338
339
340
time.sleep(refresh_time)
0 commit comments