Merge pull request 'fix' (#44) from master into prod

Reviewed-on: #44
This commit is contained in:
emmatveev 2024-12-28 13:50:12 +03:00
commit 43184acb16

View File

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