From 6e88c0096942e008bb55d29b5696a058a2c1e013 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Nov 2022 14:20:28 -0700 Subject: Don't waste DB rows on bad inbox actors Seems Sidekiq will keep trying to deliver messages even when the actor no longer exists? --- stator/runner.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'stator/runner.py') diff --git a/stator/runner.py b/stator/runner.py index 7daf921..21c6128 100644 --- a/stator/runner.py +++ b/stator/runner.py @@ -5,10 +5,9 @@ import traceback import uuid from typing import List, Optional, Type -from asgiref.sync import sync_to_async -from django.conf import settings from django.utils import timezone +from core import exceptions from stator.models import StatorModel @@ -93,10 +92,7 @@ class StatorRunner: ) await instance.atransition_attempt() except BaseException as e: - if settings.SENTRY_ENABLED: - from sentry_sdk import capture_exception - - await sync_to_async(capture_exception, thread_sensitive=False)(e) + await exceptions.acapture_exception(e) traceback.print_exc() def remove_completed_tasks(self): -- cgit v1.2.3