routing_key=action_constants.LIVEACTION_STATUS_PAUSING) ACTIONRUNNER_RESUME_QUEUE = liveaction.get_status_management_queue( 'st2.actionrunner.resume', routing_key=action_constants.LIVEACTION_STATUS_RESUMING) # Used by the exporter service EXPORTER_WORK_QUEUE = execution.get_queue('st2.exporter.work', routing_key=publishers.UPDATE_RK) # Used by the notifier service NOTIFIER_ACTIONUPDATE_WORK_QUEUE = execution.get_queue( 'st2.notifiers.execution.work', routing_key=publishers.UPDATE_RK) # Used by the results tracker service RESULTSTRACKER_ACTIONSTATE_WORK_QUEUE = actionexecutionstate.get_queue( 'st2.resultstracker.work', routing_key=publishers.CREATE_RK) # Used by the rules engine service RULESENGINE_WORK_QUEUE = reactor.get_trigger_instances_queue( name='st2.trigger_instances_dispatch.rules_engine', routing_key='#') # Used by the stream service STREAM_ANNOUNCEMENT_WORK_QUEUE = announcement.get_queue( routing_key=publishers.ANY_RK, exclusive=True, auto_delete=True) STREAM_EXECUTION_ALL_WORK_QUEUE = execution.get_queue( routing_key=publishers.ANY_RK, exclusive=True, auto_delete=True) STREAM_EXECUTION_UPDATE_WORK_QUEUE = execution.get_queue( routing_key=publishers.UPDATE_RK, exclusive=True, auto_delete=True)
import six from collections import defaultdict from kombu import Connection from st2actions.query.base import QueryContext from st2common import log as logging from st2common.models.db.executionstate import ActionExecutionStateDB from st2common.persistence.executionstate import ActionExecutionState from st2common.transport import actionexecutionstate, consumers, publishers from st2common.transport import utils as transport_utils LOG = logging.getLogger(__name__) ACTIONSTATE_WORK_Q = actionexecutionstate.get_queue('st2.resultstracker.work', routing_key=publishers.CREATE_RK) class ResultsTracker(consumers.MessageHandler): message_type = ActionExecutionStateDB def __init__(self, connection, queues): super(ResultsTracker, self).__init__(connection, queues) self._queriers = {} self._query_threads = [] self._failed_imports = set() def start(self, wait=False): self._bootstrap() super(ResultsTracker, self).start(wait=wait)