mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2025-02-17 00:04:27 +00:00
Compare commits
No commits in common. "1a7bb876403b7812070d5b67a3f6d8a35b718ec2" and "d1f2ec91b0a5fc493671e20184a7b5215b5390ba" have entirely different histories.
1a7bb87640
...
d1f2ec91b0
|
@ -1,5 +1,4 @@
|
|||
from config import instance
|
||||
import time
|
||||
import json
|
||||
import requests
|
||||
import logging
|
||||
|
@ -31,19 +30,8 @@ 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)
|
||||
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()
|
||||
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