diff --git a/config_example.json b/config_example.json index a19ae3c..5dc3553 100644 --- a/config_example.json +++ b/config_example.json @@ -83,7 +83,8 @@ "address_external": "https://photos.domain.com", "username": "", "password": "", - "album": "" + "album": "", + "timeout": 15.0 } }, "caption": { diff --git a/modules/api_client.py b/modules/api_client.py index ca08626..d9fa113 100644 --- a/modules/api_client.py +++ b/modules/api_client.py @@ -118,7 +118,7 @@ async def authorize(custom_session: Union[ClientSession, None] = None) -> str: unauthorized_client = Client( base_url=sync.config_get("address", "posting", "api"), - timeout=5.0, + timeout=sync.config_get("timeout", "posting", "api"), verify_ssl=True, raise_on_unexpected_status=True, follow_redirects=False, @@ -142,7 +142,7 @@ if not isinstance(login_token, Token): client = AuthenticatedClient( base_url=sync.config_get("address", "posting", "api"), - timeout=5.0, + timeout=sync.config_get("timeout", "posting", "api"), verify_ssl=True, raise_on_unexpected_status=True, token=login_token.access_token,