Ejemplo n.º 1
0
    def __init__(self,
                 config_loc,
                 config_override_loc,
                 emailer,
                 num_processes=1,
                 wait_timeout_sec=60):
        """
        :param config_loc: path of config.yaml
        :type config_loc: string

        :param config_override_loc: path of config-env-dev.yaml
        :type config_override_loc: string

        :param run_local: run local flag
        :type run_local: boolean

        :param num_processes: number of worker processes to use for sqs request
        :type num_processes: int

        :param wait_timeout_sec: A timeout passed to conditional variable wait
            function.  If thread is woken up on timeout, do some maintenance work.
        :type wait_timeout_sec: int

        """
        self._config_loc = config_loc
        self._config_override_loc = config_override_loc
        self._stop_requested = False
        self._run_once = False
        self.max_error_retries = staticconf.read_int('max_error_retries')
        self.etl_helper = ETLStatusHelper()
        self.jobs_db = TableConnection.get_connection('ScheduledJobs')
        self.runs_db = TableConnection.get_connection('ETLRecords')
        self._num_processes = num_processes
        self._cond = threading.Condition(threading.Lock())
        self._wait_timeout_sec = max(wait_timeout_sec, 60)
        self.emailer = emailer
Ejemplo n.º 2
0
 def get_etl_helper(self, etl_records):
     with mock.patch(
             'mycroft.models.aws_connections.TableConnection.get_connection'
     ) as mocked_etl:
         mocked_etl.return_value = etl_records
         yield ETLStatusHelper()