mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
Removed transaction from calendar actions execution. Not needed in fact.
This commit is contained in:
parent
9094547f22
commit
e382bfa19b
@ -52,10 +52,9 @@ class ScheduledAction(Job):
|
|||||||
super(ScheduledAction, self).__init__(environment)
|
super(ScheduledAction, self).__init__(environment)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
with transaction.atomic():
|
for ca in CalendarAction.objects.filter(service_pool__service__provider__maintenance_mode=False, next_execution__lt=getSqlDatetime()).order_by('next_execution'):
|
||||||
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.info('Executing calendar action {}.{} ({})'.format(ca.service_pool.name, ca.calendar.name, ca.action))
|
||||||
logger.debug('Executing calendar action {}.{}'.format(ca.service_pool.name, ca.calendar.name))
|
try:
|
||||||
try:
|
ca.execute()
|
||||||
ca.execute()
|
except Exception as e:
|
||||||
except Exception as e:
|
logger.exception('Got an exception executing calendar access action: {}'.format(e))
|
||||||
logger.exception('Got an exception executing calendar access action: {}'.format(e))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user