Skip to content

Commit

Permalink
implement flush in write_api
Browse files Browse the repository at this point in the history
  • Loading branch information
minsungoh committed Oct 19, 2024
1 parent 7e01edb commit eb6fe83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions influxdb_client/client/write_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ def write_payload(payload):

def flush(self):
"""Flush data."""
# TODO
pass
if self._subject:
self._subject.on_completed()

def close(self):
"""Flush data and dispose a batching buffer."""
Expand All @@ -411,8 +411,8 @@ def __exit__(self, exc_type, exc_val, exc_tb):

def __del__(self):
"""Close WriteApi."""
self.flush()
if self._subject:
self._subject.on_completed()
self._subject.dispose()
self._subject = None

Expand Down

0 comments on commit eb6fe83

Please sign in to comment.