Skip to content

Commit

Permalink
do not create sender at close
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Jun 5, 2024
1 parent 1e58a7e commit b92d5f1
Show file tree
Hide file tree
Showing 2 changed files with 4 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()
5 changes: 4 additions & 1 deletion fluent/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ def close(self):
self.acquire()
try:
try:
self.sender.close()
s = self._sender
self._sender = None
if s is not None:
s.close()
finally:
super().close()
finally:
Expand Down

0 comments on commit b92d5f1

Please sign in to comment.