Esempio n. 1
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     try:
         how_many = int(args[0])
     except (ValueError, TypeError, IndexError):
         how_many = 1000
     if options['remote']:
         dummy_horde.delay(how_many=how_many, interactive=False)
     else:
         dummy_horde(how_many=how_many, interactive=True)
Esempio n. 2
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     try:
         how_many = int(args[0])
     except (ValueError, TypeError, IndexError):
         how_many = 1000
     if options['remote']:
         dummy_horde.delay(how_many=how_many, interactive=False)
     else:
         dummy_horde(how_many=how_many, interactive=True)
Esempio n. 3
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     try:
         how_many = int(args[0])
     except (ValueError, TypeError, IndexError):
         how_many = 1000
     if options['remote']:
         queue = django_rq.get_queue()
         queue.enqueue_call(
             func=dummy_horde,
             kwargs=dict(how_many=how_many, interactive=False),
             timeout=60,
             result_ttl=0,
         )
     else:
         dummy_horde(how_many=how_many, interactive=True)
Esempio n. 4
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     try:
         how_many = int(args[0])
     except (ValueError, TypeError, IndexError):
         how_many = 1000
     if options['remote']:
         queue = django_rq.get_queue()
         queue.enqueue_call(
             func=dummy_horde,
             kwargs=dict(how_many=how_many, interactive=False),
             timeout=60,
             result_ttl=0,
         )
     else:
         dummy_horde(how_many=how_many, interactive=True)