mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-12-22 20:43:32 +02:00
Retry get context
This commit is contained in:
parent
d1f2ec91b0
commit
d57caad024
1 changed files with 12 additions and 1 deletions
|
@ -30,8 +30,19 @@ def mark_as_read_notification(id_notification):
|
|||
|
||||
def get_status_context(status_id):
|
||||
r = requests.get(instance_point + f"/statuses/{status_id}/context", headers=headers)
|
||||
return r.json()
|
||||
if r.status_code == 200:
|
||||
return r.json()
|
||||
else:
|
||||
http_code = r.status_code
|
||||
logger.error(f'Ошибка получения контекста треда {status_id}: {http_code}')
|
||||
while r.status_code != 200:
|
||||
time.sleep(30)
|
||||
logger.info('Повторный запрос треда...')
|
||||
r = requests.get(instance_point + f"/statuses/{status_id}/context", headers=headers)
|
||||
return r.json()
|
||||
|
||||
|
||||
|
||||
|
||||
def get_status(status_id):
|
||||
r = requests.get(instance_point + f"/statuses/{status_id}", headers=headers)
|
||||
|
|
Loading…
Reference in a new issue