コード例 #1
0
ファイル: dummy.py プロジェクト: szaydel/ralph
 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)
コード例 #2
0
ファイル: dummy.py プロジェクト: damjanek/ralph
 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)
コード例 #3
0
ファイル: dummy.py プロジェクト: rainsome-org1/ralph
 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)
コード例 #4
0
ファイル: dummy.py プロジェクト: andrzej-jankowski/ralph
 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)