forked from CGM_Public/pretix_original
Use robust plugin calling in runperiodic
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from django.conf import settings
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
@@ -8,5 +9,12 @@ class Command(BaseCommand):
|
|||||||
help = "Run periodic tasks"
|
help = "Run periodic tasks"
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
periodic_task.send(self)
|
for recv, resp in periodic_task.send_robust(self):
|
||||||
|
if isinstance(resp, Exception):
|
||||||
|
if settings.SENTRY_ENABLED:
|
||||||
|
from sentry_sdk import capture_exception
|
||||||
|
capture_exception(resp)
|
||||||
|
else:
|
||||||
|
raise resp
|
||||||
|
|
||||||
call_command('clearsessions')
|
call_command('clearsessions')
|
||||||
|
|||||||
@@ -601,12 +601,14 @@ LOGGING = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SENTRY_ENABLED = False
|
||||||
if config.has_option('sentry', 'dsn'):
|
if config.has_option('sentry', 'dsn'):
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.celery import CeleryIntegration
|
from sentry_sdk.integrations.celery import CeleryIntegration
|
||||||
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
|
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
|
||||||
from .sentry import PretixSentryIntegration, setup_custom_filters
|
from .sentry import PretixSentryIntegration, setup_custom_filters
|
||||||
|
|
||||||
|
SENTRY_ENABLED = True
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
dsn=config.get('sentry', 'dsn'),
|
dsn=config.get('sentry', 'dsn'),
|
||||||
integrations=[
|
integrations=[
|
||||||
|
|||||||
Reference in New Issue
Block a user