Compare commits

..

No commits in common. "39bca8ead99aa8805cb571b44d537c38b5230dbd" and "43184acb168b2ed0b6115af42e71c1ec12ae1810" have entirely different histories.

View File

@ -17,11 +17,10 @@ class QueuesException(Exception):
class TasksHandlerMixin: class TasksHandlerMixin:
def poll(self): def poll(self):
while True: while True:
try: response = requests.get(f'{QUEUES_URL}/api/v1/take', headers={'queue': self.queue_name})
response = requests.get(f'{QUEUES_URL}/api/v1/take', headers={'queue': self.queue_name}).json() print('Got status', response.status_code)
except requests.JSONDecodeError: print('Got body', response.content.decode('utf-8'))
print('Unable to decode json') response = response.json()
continue
task = response.get('task') task = response.get('task')
if not task: if not task:
time.sleep(0.2) time.sleep(0.2)