Adjust inventory computed field calculations to happen in the celery context

This commit is contained in:
Matthew Jones
2014-04-30 14:35:25 -04:00
parent 2497610944
commit ac94c11fd7
9 changed files with 71 additions and 80 deletions

View File

@@ -13,6 +13,7 @@ from django.utils.timezone import now, make_aware, get_default_timezone
# AWX
from awx.main.models.base import *
from awx.main.utils import ignore_inventory_computed_fields
from django.core.urlresolvers import reverse
logger = logging.getLogger('awx.main.models.schedule')
@@ -104,7 +105,6 @@ class Schedule(CommonModel):
self.dtend = make_aware(datetime.datetime.strptime(until_date, "%Y%m%dT%H%M%SZ"), get_default_timezone())
if 'count' in self.rrule.lower():
self.dtend = future_rs[-1]
from awx.main.signals import ignore_inventory_computed_fields
with ignore_inventory_computed_fields():
self.unified_job_template.update_computed_fields()