fix #39
@ -15,7 +15,8 @@ class TasksHandlerMixin:
|
|||||||
response: tasks_pb2.TakeResponse = self.stub.Take(tasks_pb2.TakeRequest(queue=self.queue_name))
|
response: tasks_pb2.TakeResponse = self.stub.Take(tasks_pb2.TakeRequest(queue=self.queue_name))
|
||||||
task = response.task
|
task = response.task
|
||||||
if not task:
|
if not task:
|
||||||
time.sleep(0.2)
|
if response.retry_after:
|
||||||
|
time.sleep(response.retry_after)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
payload = json_format.MessageToDict(task.payload)
|
payload = json_format.MessageToDict(task.payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user