mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
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.base import BaseCommand
|
||||
|
||||
@@ -8,5 +9,12 @@ class Command(BaseCommand):
|
||||
help = "Run periodic tasks"
|
||||
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user