Skip to content

Commit

Permalink
use timeout in force_flush (#2118)
Browse files Browse the repository at this point in the history
* use timeout in force_flush

* fix lint

* Update opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py

Co-authored-by: Srikanth Chekuri <[email protected]>

* fix lint

Co-authored-by: Srikanth Chekuri <[email protected]>
  • Loading branch information
alrex and srikanthccv committed Oct 29, 2021
1 parent acfd22e commit 8451ca4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def force_flush(self, timeout_millis: Optional[int] = None) -> bool:
flush_request = self._get_or_create_flush_request()
self._condition.notify_all()

ret = flush_request.event.wait()
ret = flush_request.event.wait(timeout_millis / 1e3)
if not ret:
_logger.warning("Timeout was exceeded in force_flush().")
return ret

0 comments on commit 8451ca4

Please sign in to comment.