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 10
10
from sentry_sdk .utils import format_timestamp
11
11
12
12
if MYPY :
13
- from typing import Callable
14
- from typing import Optional
15
13
from typing import Any
14
+ from typing import Callable
16
15
from typing import Dict
17
- from typing import List
18
16
from typing import Generator
17
+ from typing import List
18
+ from typing import Optional
19
+ from typing import Union
19
20
20
21
21
22
def is_auto_session_tracking_enabled (hub = None ):
22
- # type: (Optional[sentry_sdk.Hub]) -> bool
23
+ # type: (Optional[sentry_sdk.Hub]) -> Union[Any, bool, None]
23
24
"""Utility function to find out if session tracking is enabled."""
24
25
if hub is None :
25
26
hub = sentry_sdk .Hub .current
27
+
26
28
should_track = hub .scope ._force_auto_session_tracking
29
+
27
30
if should_track is None :
28
31
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
+
30
34
return should_track
31
35
32
36
You can’t perform that action at this time.
0 commit comments