def update_progress(msg): """ Updates custom PROGRESS state of task. Also sends a message to the subpub channel for status updates. We EventSource push notification so reduce server load. The custom PROGRESS state is used for XHR poll fallback. """ current_app.logger.info("(+++) PROGRESS: {0} (TASK: {1})".format(msg, current_task.request.id)) current_task.update_state(state='PROGRESS', meta={'message': msg}) #now = datetime.datetime.now().replace(microsecond=0).time() red.publish(current_task.request.id, '{0}'.format(msg))
def update_progress(msg): """ Updates custom PROGRESS state of task. Also sends a message to the subpub channel for status updates. We EventSource push notification so reduce server load. The custom PROGRESS state is used for XHR poll fallback. """ current_app.logger.info("(+++) PROGRESS: {0} (TASK: {1})".format( msg, current_task.request.id)) current_task.update_state(state='PROGRESS', meta={'message': msg}) #now = datetime.datetime.now().replace(microsecond=0).time() red.publish(current_task.request.id, '{0}'.format(msg))
def ping(): red.publish('test', 'Hello!') return redirect('/')