Skip to content

Commit 65ee74b

Browse files
committed
fix: use ThreadPoolScheduler for WriteApi batch subject to prevent create threads repeteadly
1 parent a804c51 commit 65ee74b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

influxdb_client/client/write_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ def __init__(self,
258258
self._disposable = self._subject.pipe(
259259
# Split incoming data to windows by batch_size or flush_interval
260260
ops.window_with_time_or_count(count=write_options.batch_size,
261-
timespan=timedelta(milliseconds=write_options.flush_interval)),
261+
timespan=timedelta(milliseconds=write_options.flush_interval),
262+
scheduler=ThreadPoolScheduler(1)),
262263
# Map window into groups defined by 'organization', 'bucket' and 'precision'
263264
ops.flat_map(lambda window: window.pipe(
264265
# Group window by 'organization', 'bucket' and 'precision'

0 commit comments

Comments
 (0)