def update_progress(self): progress = spread_dict( self._statement_progress, { "total": len(self._statement_ranges), }, ) self._celery_task.update_state(state="PROGRESS", meta=progress)
def on_query_start(self): with DBSession() as session: query_execution = qe_logic.update_query_execution( self._query_execution_id, status=QueryExecutionStatus.RUNNING, session=session, ).to_dict() query_execution = spread_dict(query_execution, { "total": len(self._statement_ranges), }) socketio.emit( "query_start", query_execution, namespace=QUERY_EXECUTION_NAMESPACE, room=self._query_execution_id, ) self.update_progress()