File tree Expand file tree Collapse file tree 2 files changed +11
-16
lines changed
Expand file tree Collapse file tree 2 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -280,14 +280,17 @@ def setup_integrations(
280280 return integrations
281281
282282
283- def _enable_integration (integration : "Integration" ) -> "Optional[Integration]" :
283+ def _enable_integration (integration : "Integration" ) -> None :
284284 identifier = integration .identifier
285- client = sentry_sdk .get_client ()
286285
287286 with _installer_lock :
287+ client = sentry_sdk .get_client ()
288+ if not client .is_active ():
289+ return
290+
288291 if identifier in client .integrations :
289292 logger .debug ("Integration already enabled: %s" , identifier )
290- return None
293+ return
291294
292295 logger .debug ("Setting up integration %s" , identifier )
293296 _processed_integrations .add (identifier )
@@ -296,10 +299,10 @@ def _enable_integration(integration: "Integration") -> "Optional[Integration]":
296299 integration .setup_once_with_options (client .options )
297300 except DidNotEnable as e :
298301 logger .debug ("Did not enable integration %s: %s" , identifier , e )
299- return None
300- else :
301- _installed_integrations .add (identifier )
302- return integration
302+ return
303+
304+ _installed_integrations .add (identifier )
305+ client . integrations [ integration . identifier ] = integration
303306
304307
305308def _check_minimum_version (
Original file line number Diff line number Diff line change @@ -165,12 +165,4 @@ async def async_entrypoint():
165165 sentry_sdk.init(disabled_integrations=[...]), this function will ignore that
166166 and the integration will be enabled.
167167 """
168- client = sentry_sdk .get_client ()
169- if not client .is_active ():
170- return
171-
172- integration = _enable_integration (AsyncioIntegration (* args , ** kwargs ))
173- if integration is None :
174- return
175-
176- client .integrations [integration .identifier ] = integration
168+ _enable_integration (AsyncioIntegration (* args , ** kwargs ))
You can’t perform that action at this time.
0 commit comments