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
2 people authored and lzchen committed Nov 4, 2021
1 parent 914ee51 commit 4714a4e
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 4714a4e

Please sign in to comment.