From 5e8506cc12f0e7a11c22b7b39980a78243e5139b Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 16 Aug 2023 13:20:25 +0200 Subject: [PATCH] Attempt to work around #40 --- config_example.json | 3 ++- modules/api_client.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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,