示例#1
0
def clear_queue(app: 'celery.Celery', name: str):
    """
    Clear a Celery queue.

    :param app: Celery app.
    :param name: Queue name.
    """
    manager = amqp(app=app)
    manager.run('queue.purge', name)
示例#2
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     self.assertIs(cls.call_args[1]['app'], self.app)
示例#3
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     assert cls.call_args[1]['app'] is self.app
示例#4
0
def init_worker(*args, **kwargs):
    logger.info('Initializing worker.')
    amqp_cli = amqp(app=app)
    amqp_cli.run('queue.purge', 'poll_instagram')
    logger.info('Purged missing beat in queue poll_instagram')
示例#5
0
文件: test_amqp.py 项目: Dalar/celery
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     self.assertIs(cls.call_args[1]['app'], self.app)
示例#6
0
文件: test_amqp.py 项目: Scalr/celery
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     assert cls.call_args[1]['app'] is self.app