Skip to content

Commit

Permalink
do not create sender at close (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Jun 6, 2024
1 parent 1e58a7e commit ef7be65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
16 changes: 0 additions & 16 deletions fluent/asynchandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,3 @@ class FluentHandler(handler.FluentHandler):

def getSenderClass(self):
return asyncsender.FluentSender

def close(self):
self.acquire()
try:
try:
self.sender.close()
finally:
super().close()
finally:
self.release()

def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
4 changes: 3 additions & 1 deletion fluent/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ def close(self):
self.acquire()
try:
try:
self.sender.close()
if self._sender is not None:
self._sender.close()
self._sender = None
finally:
super().close()
finally:
Expand Down

0 comments on commit ef7be65

Please sign in to comment.