8000 fix: Add Hub.flush as well · etherscan-io/sentry-python@8418fd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8418fd1

Browse files
committed
fix: Add Hub.flush as well
1 parent bbafe17 commit 8418fd1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sentry_sdk/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def inner():
8585
@hubmethod
8686
def flush(timeout=None, callback=None):
8787
hub = Hub.current
88-
if hub is not None and hub.client is not None:
89-
return hub.client.flush(timeout=timeout, callback=callback)
88+
if hub is not None:
89+
return hub.flush(timeout=timeout, callback=callback)
9090

9191

9292
@hubmethod

sentry_sdk/hub.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ def inner():
338338

339339
return inner()
340340

341+
def flush(self, timeout=None, callback=None):
342+
"""Alias for self.client.flush"""
343+
client, scope = self._stack[-1]
344+
if client is not None:
345+
return client.flush(timeout=timeout, callback=callback)
346+
341347

342348
GLOBAL_HUB = Hub()
343349
_local.set(GLOBAL_HUB)

0 commit comments

Comments
 (0)
0