Skip to content

Commit 383c0b5

Browse files
authored
Merge branch 'master' into potel-base
2 parents 83871a0 + 3e28853 commit 383c0b5

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

sentry_sdk/integrations/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _new_chat_completion_common(f, *args, **kwargs):
137137

138138
span = sentry_sdk.start_span(
139139
op=consts.OP.OPENAI_CHAT_COMPLETIONS_CREATE,
140-
description="Chat Completion",
140+
name="Chat Completion",
141141
origin=OpenAIIntegration.origin,
142142
only_if_parent=True,
143143
)

sentry_sdk/integrations/rq.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,13 @@ def sentry_patched_perform_job(self, job, *args, **kwargs):
9494

9595
def sentry_patched_handle_exception(self, job, *exc_info, **kwargs):
9696
# type: (Worker, Any, *Any, **Any) -> Any
97-
# Note, the order of the `or` here is important,
98-
# because calling `job.is_failed` will change `_status`.
99-
if job._status == JobStatus.FAILED or job.is_failed:
97+
retry = (
98+
hasattr(job, "retries_left")
99+
and job.retries_left
100+
and job.retries_left > 0
101+
)
102+
failed = job._status == JobStatus.FAILED or job.is_failed
103+
if failed and not retry:
100104
_capture_exception(exc_info)
101105

102106
return old_handle_exception(self, job, *exc_info, **kwargs)

tests/integrations/rq/test_rq.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,6 @@ def test_traces_sampler_gets_correct_values_in_sampling_context(
251251
@pytest.mark.skipif(
252252
parse_version(rq.__version__) < (1, 5), reason="At least rq-1.5 required"
253253
)
254-
@pytest.mark.skipif(
255-
parse_version(rq.__version__) >= (2,),
256-
reason="Test broke in RQ 2.0. Investigate and fix. "
257-
"See https://github.com/getsentry/sentry-python/issues/3707.",
258-
)
259254
def test_job_with_retries(sentry_init, capture_events):
260255
sentry_init(integrations=[RqIntegration()])
261256
events = capture_events()

0 commit comments

Comments
 (0)