From e382bfa19b3fddad705dbceea6012c9a53602ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Mon, 3 Dec 2018 10:45:31 +0100 Subject: [PATCH] Removed transaction from calendar actions execution. Not needed in fact. --- server/src/uds/core/workers/ScheduledAction.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/server/src/uds/core/workers/ScheduledAction.py b/server/src/uds/core/workers/ScheduledAction.py index ca8bf393c..84f65b901 100644 --- a/server/src/uds/core/workers/ScheduledAction.py +++ b/server/src/uds/core/workers/ScheduledAction.py @@ -52,10 +52,9 @@ class ScheduledAction(Job): super(ScheduledAction, self).__init__(environment) def run(self): - with transaction.atomic(): - for ca in CalendarAction.objects.select_for_update().filter(service_pool__service__provider__maintenance_mode=False, next_execution__lt=getSqlDatetime()).order_by('next_execution'): - logger.debug('Executing calendar action {}.{}'.format(ca.service_pool.name, ca.calendar.name)) - try: - ca.execute() - except Exception as e: - logger.exception('Got an exception executing calendar access action: {}'.format(e)) + for ca in CalendarAction.objects.filter(service_pool__service__provider__maintenance_mode=False, next_execution__lt=getSqlDatetime()).order_by('next_execution'): + logger.info('Executing calendar action {}.{} ({})'.format(ca.service_pool.name, ca.calendar.name, ca.action)) + try: + ca.execute() + except Exception as e: + logger.exception('Got an exception executing calendar access action: {}'.format(e))