Skip to content

Commit 626b529

Browse files
remove method
1 parent 3a4aeea commit 626b529

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

sentry_sdk/integrations/django/caching.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ def _get_span_description(method_name, args, kwargs):
3333
return _key_as_string(_get_safe_key(method_name, args, kwargs))
3434

3535

36-
def _set_address_and_port(span, address, port):
37-
# type: (sentry_sdk.tracing.Span, Optional[str], Optional[int]) -> None
38-
if address is not None:
39-
span.set_data(SPANDATA.NETWORK_PEER_ADDRESS, address)
40-
41-
if port is not None:
42-
span.set_data(SPANDATA.NETWORK_PEER_PORT, port)
43-
44-
4536
def _patch_cache_method(cache, method_name, address, port):
4637
# type: (CacheHandler, str, Optional[str], Optional[int]) -> None
4738
from sentry_sdk.integrations.django import DjangoIntegration
@@ -68,7 +59,11 @@ def _instrument_call(
6859
value = original_method(*args, **kwargs)
6960

7061
with capture_internal_exceptions():
71-
_set_address_and_port(span, address, port)
62+
if address is not None:
63+
span.set_data(SPANDATA.NETWORK_PEER_ADDRESS, address)
64+
65+
if port is not None:
66+
span.set_data(SPANDATA.NETWORK_PEER_PORT, port)
7267

7368
key = _get_safe_key(method_name, args, kwargs)
7469
if key is not None:

0 commit comments

Comments
 (0)