Skip to content

Commit

Permalink
fix: Cancel the active timer on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Sep 25, 2024
1 parent 77ffb9a commit 240b32b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/axiom_py/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, client: Client, dataset: str, level=NOTSET, interval=1):
self.timer = Timer(self.interval, self.flush)

# Make sure we flush before the client shuts down
client.before_shutdown(self.flush)
client.before_shutdown(lambda: self.flush(), self.timer.cancel())

def emit(self, record):
"""Emit sends a log to Axiom."""
Expand Down

0 comments on commit 240b32b

Please sign in to comment.