File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1010from sentry_sdk .utils import format_timestamp
1111
1212if MYPY :
13- from typing import Callable
14- from typing import Optional
1513 from typing import Any
14+ from typing import Callable
1615 from typing import Dict
17- from typing import List
1816 from typing import Generator
17+ from typing import List
18+ from typing import Optional
19+ from typing import Union
1920
2021
2122def is_auto_session_tracking_enabled (hub = None ):
22- # type: (Optional[sentry_sdk.Hub]) -> bool
23+ # type: (Optional[sentry_sdk.Hub]) -> Union[Any, bool, None]
2324 """Utility function to find out if session tracking is enabled."""
2425 if hub is None :
2526 hub = sentry_sdk .Hub .current
27+
2628 should_track = hub .scope ._force_auto_session_tracking
29+
2730 if should_track is None :
2831 client_options = hub .client .options if hub .client else {}
29- should_track = client_options ["auto_session_tracking" ]
32+ should_track = client_options .get ("auto_session_tracking" , False )
33+
3034 return should_track
3135
3236
You can’t perform that action at this time.
0 commit comments