Ejemplo n.º 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)
Ejemplo n.º 2
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     self.assertIs(cls.call_args[1]['app'], self.app)
Ejemplo n.º 3
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     assert cls.call_args[1]['app'] is self.app
Ejemplo n.º 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')
Ejemplo n.º 5
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     self.assertIs(cls.call_args[1]['app'], self.app)
Ejemplo n.º 6
0
 def test_command(self, cls):
     x = amqp(app=self.app)
     x.run()
     assert cls.call_args[1]['app'] is self.app