Add schedule based socket.io events for AC-1333

This commit is contained in:
Matthew Jones
2014-06-10 15:58:11 -04:00
parent b6ba138522
commit e72728b38c
3 changed files with 11 additions and 3 deletions

View File

@@ -13,7 +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 awx.main.utils import ignore_inventory_computed_fields, emit_websocket_notification
from django.core.urlresolvers import reverse
logger = logging.getLogger('awx.main.models.schedule')
@@ -105,6 +105,7 @@ 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]
emit_websocket_notification('/socket.io/schedules', 'schedule_change', dict(id=self.id))
with ignore_inventory_computed_fields():
self.unified_job_template.update_computed_fields()