@task
def test_task():
try:
t = 60*3
while t > 0:
r = requests.get \
('url')
if r.status_code == 200:
strs = json.loads(r.text)
bal = float(strs['totalReceived'])
total = float(strs['totalSent'])
if bal == total:
return "Все ок"
else:
time.sleep(1*60)
t -= 1*60
continue
else:
time.sleep(1*60)
t -= 1*60
continue
if t == 0:
return "Ошибка"
except:
return "Ошибочка"