コード例 #1
0
ファイル: __init__.py プロジェクト: pashinin/celery
 def _process_task(self, req):
     """Process task by sending it to the pool of workers."""
     try:
         req.execute_using_pool(self.pool)
     except TaskRevokedError:
         try:
             self._quick_release()  # Issue 877
         except AttributeError:
             pass
     except Exception as exc:
         logger.critical("Internal error: %r\n%s", exc, traceback.format_exc(), exc_info=True)
コード例 #2
0
 def start(self):
     try:
         self.blueprint.start(self)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('Unrecoverable error: %r', exc, exc_info=True)
         self.stop(exitcode=EX_FAILURE)
     except SystemExit as exc:
         self.stop(exitcode=exc.code)
     except KeyboardInterrupt:
         self.stop(exitcode=EX_FAILURE)
コード例 #3
0
ファイル: __init__.py プロジェクト: xmn1986/celery
 def _process_task(self, req):
     """Process task by sending it to the pool of workers."""
     try:
         req.execute_using_pool(self.pool)
     except TaskRevokedError:
         try:
             self._quick_release()   # Issue 877
         except AttributeError:
             pass
     except Exception as exc:
         logger.critical('Internal error: %r\n%s',
                         exc, traceback.format_exc(), exc_info=True)
コード例 #4
0
ファイル: worker.py プロジェクト: 2216288075/meiduo_project
 def start(self):
     try:
         self.blueprint.start(self)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('Unrecoverable error: %r', exc, exc_info=True)
         self.stop(exitcode=EX_FAILURE)
     except SystemExit as exc:
         self.stop(exitcode=exc.code)
     except KeyboardInterrupt:
         self.stop(exitcode=EX_FAILURE)
コード例 #5
0
ファイル: worker.py プロジェクト: Scalr/celery
 def start(self):
     _start = functools.partial(self.blueprint.start, self)
     try:
         retry_over_time(_start, amqp_exceptions.NotFound, errback=self.on_error)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('Unrecoverable error: %r', exc, exc_info=True)
         self.stop(exitcode=EX_FAILURE)
     except SystemExit as exc:
         self.stop(exitcode=exc.code)
     except KeyboardInterrupt:
         self.stop(exitcode=EX_FAILURE)