Ejemplo n.º 1
0
 def _process_task_declarations(self):
     task_declarations = TaskDeclaration.enumerate(
         created_by_user=False, db=self.db, encryption=self.encryption)
     for task_declaration in task_declarations:
         try:
             self._process_task_declaration(task_declaration)
         except Exception as ex:
             logger.exception(ex)
Ejemplo n.º 2
0
    def process_tasks(self):
        while True:
            try:
                for task_declaration in TaskDeclaration.enumerate(db=self.db, encryption=self.encryption):
                    if task_declaration.in_finished_state:
                        continue

                    self._process_task_declaration(task_declaration)

                time.sleep(settings.PRODUCER_PROCESS_INTERVAL)
            except Exception as e:
                logger.exception(e)
Ejemplo n.º 3
0
 def _process_task_declarations(self):
     task_declarations = TaskDeclaration.enumerate(
         created_by_user=False, db=self.db, encryption=self.encryption)
     for task_declaration in task_declarations:
         try:
             self._process_task_declaration(task_declaration)
         except requests.exceptions.ConnectionError as ex:
             # hide from sentry connection errors to parity
             parity_ports = [
                 settings.PARITY_JSONRPC_PORT,
                 settings.PARITY_WEBSOCKET_PORT
             ]
             if ex.args[0].pool.port in parity_ports and ex.args[
                     0].pool.host == settings.PARITY_HOST:
                 logger.info(ex)
             else:
                 raise
         except Exception as ex:
             logger.exception(ex)