mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
worker: Check if Sentry is initialized before calling add_breadcrumb.
Otherwise we get spammed with “Dropped breadcrumb because no client
bound” log messages.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e8faa4a029
)
This commit is contained in:
committed by
Tim Abbott
parent
25c8d2abd0
commit
e916abf31e
@@ -173,12 +173,16 @@ class QueueProcessingWorker(ABC):
|
|||||||
name=f"consume {self.queue_name}",
|
name=f"consume {self.queue_name}",
|
||||||
custom_sampling_context={"queue": self.queue_name},
|
custom_sampling_context={"queue": self.queue_name},
|
||||||
):
|
):
|
||||||
sentry_sdk.add_breadcrumb(
|
if sentry_sdk.is_initialized():
|
||||||
type="debug",
|
sentry_sdk.add_breadcrumb(
|
||||||
category="queue_processor",
|
type="debug",
|
||||||
message=f"Consuming {self.queue_name}",
|
category="queue_processor",
|
||||||
data={"events": events, "local_queue_size": self.get_remaining_local_queue_size()},
|
message=f"Consuming {self.queue_name}",
|
||||||
)
|
data={
|
||||||
|
"events": events,
|
||||||
|
"local_queue_size": self.get_remaining_local_queue_size(),
|
||||||
|
},
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
if self.idle:
|
if self.idle:
|
||||||
# We're reactivating after having gone idle due to emptying the queue.
|
# We're reactivating after having gone idle due to emptying the queue.
|
||||||
|
Reference in New Issue
Block a user