mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 01:08:48 -03:30
add final_line_count to EOF websocket
This commit is contained in:
@@ -162,6 +162,7 @@ class CallbackBrokerWorker(ConsumerMixin):
|
|||||||
|
|
||||||
if body.get('event') == 'EOF':
|
if body.get('event') == 'EOF':
|
||||||
try:
|
try:
|
||||||
|
final_line_count = body.get('final_line_count', 0)
|
||||||
logger.info('Event processing is finished for Job {}, sending notifications'.format(job_identifier))
|
logger.info('Event processing is finished for Job {}, sending notifications'.format(job_identifier))
|
||||||
# EOF events are sent when stdout for the running task is
|
# EOF events are sent when stdout for the running task is
|
||||||
# closed. don't actually persist them to the database; we
|
# closed. don't actually persist them to the database; we
|
||||||
@@ -169,7 +170,7 @@ class CallbackBrokerWorker(ConsumerMixin):
|
|||||||
# approximation for when a job is "done"
|
# approximation for when a job is "done"
|
||||||
emit_channel_notification(
|
emit_channel_notification(
|
||||||
'jobs-summary',
|
'jobs-summary',
|
||||||
dict(group_name='jobs', unified_job_id=job_identifier)
|
dict(group_name='jobs', unified_job_id=job_identifier, final_line_count=final_line_count)
|
||||||
)
|
)
|
||||||
# Additionally, when we've processed all events, we should
|
# Additionally, when we've processed all events, we should
|
||||||
# have all the data we need to send out success/failure
|
# have all the data we need to send out success/failure
|
||||||
|
|||||||
@@ -989,7 +989,7 @@ class OutputEventFilter(object):
|
|||||||
if value:
|
if value:
|
||||||
self._emit_event(value)
|
self._emit_event(value)
|
||||||
self._buffer = StringIO()
|
self._buffer = StringIO()
|
||||||
self._event_callback(dict(event='EOF'))
|
self._event_callback(dict(event='EOF', final_line_count=self._start_line))
|
||||||
|
|
||||||
def _emit_event(self, buffered_stdout, next_event_data=None):
|
def _emit_event(self, buffered_stdout, next_event_data=None):
|
||||||
next_event_data = next_event_data or {}
|
next_event_data = next_event_data or {}
|
||||||
|
|||||||
Reference in New Issue
Block a user