Skip to content

Commit

Permalink
[Sentry] remove deprecated hub
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 10, 2025
1 parent c958dcf commit 334c4f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 3 additions & 5 deletions octobot/community/errors_upload/sentry_aiohttp_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,11 @@ def capture_event(
def capture_envelope(
self, envelope: sentry_sdk.envelope.Envelope
) -> None:
hub = self.hub_cls.current

async def send_envelope_wrapper() -> None:
with hub: # pylint: disable=not-context-manager
with sentry_sdk.utils.capture_internal_exceptions():
await self._async_send_envelope(envelope)
self._flush_client_reports()
with sentry_sdk.utils.capture_internal_exceptions():
await self._async_send_envelope(envelope)
self._flush_client_reports()

if not self._worker.submit(send_envelope_wrapper):
self.on_dropped_event("full_queue")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def _before_send_callback(event: dict, hint: dict):
SENTRY_CONFIG["enabled"] = False
if handle and hasattr(handle._client.transport, "async_kill"):
await handle._client.transport.async_kill()
client = sentry_sdk.Hub.current.client
if client is not None:
client.close(timeout=0)


def _mocked_context(return_value):
Expand Down

0 comments on commit 334c4f0

Please sign in to comment.