mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 19:33:34 +02:00
Set some timeouts for initial connection to instance
This commit is contained in:
parent
50e8a30852
commit
da86e366a9
1 changed files with 4 additions and 3 deletions
|
@ -48,7 +48,7 @@ class current_instance:
|
|||
current_instance.token = new_token
|
||||
current_instance.listen_token = None
|
||||
if new_token:
|
||||
current_instance.s.get(f'https://{current_instance.instance}')
|
||||
current_instance.s.get(f'https://{current_instance.instance}', timeout=30)
|
||||
current_instance.s.headers.update({"Authorization": "Bearer " + new_token})
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ if current_instance.token:
|
|||
current_instance.s.headers.update({"Authorization": "Bearer " + current_instance.token})
|
||||
else:
|
||||
# Get cookies from unauthorized instance for working some functionality (radios)
|
||||
current_instance.s.get(f'https://{current_instance.instance}/')
|
||||
current_instance.s.get(f'https://{current_instance.instance}/', timeout=30)
|
||||
|
||||
|
||||
@logger.catch
|
||||
|
@ -79,7 +79,8 @@ def get_instance_settings():
|
|||
|
||||
def get_node_info():
|
||||
r = current_instance.s.get(
|
||||
f'https://{current_instance.instance}/api/v1/instance/nodeinfo/2.0/')
|
||||
f'https://{current_instance.instance}/api/v1/instance/nodeinfo/2.0/',
|
||||
timeout=30)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
|
|
Loading…
Reference in a new issue