From 53b379926e0eada30a91bcf2e57a685c6cc124d2 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 7 Aug 2024 14:51:02 +0300 Subject: [PATCH 1/2] Increase request timeout. --- moonstreamapi/moonstreamapi/routes/subscriptions.py | 4 +++- moonstreamapi/moonstreamapi/settings.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moonstreamapi/moonstreamapi/routes/subscriptions.py b/moonstreamapi/moonstreamapi/routes/subscriptions.py index f53a3982..7b8a23b6 100644 --- a/moonstreamapi/moonstreamapi/routes/subscriptions.py +++ b/moonstreamapi/moonstreamapi/routes/subscriptions.py @@ -36,6 +36,7 @@ MOONSTREAM_ENTITIES_RESERVED_TAGS, THREAD_TIMEOUT_SECONDS, MOONSTREAM_DB_V3_INDEX_INSTANCE, + BUGOUT_REQUEST_TIMEOUT_SECONDS, ) from ..settings import bugout_client as bc from ..web3_provider import yield_web3_provider @@ -192,6 +193,7 @@ async def add_subscription_handler( title=label, required_fields=required_fields, secondary_fields=content, + timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS, ) except EntityJournalNotFoundException as e: raise MoonstreamHTTPException( @@ -200,7 +202,7 @@ async def add_subscription_handler( internal_error=e, ) except Exception as e: - logger.error(f"Failed to get journal id") + logger.error(f"Failed to create subscription entity error: {str(e)}") raise MoonstreamHTTPException( status_code=500, internal_error=e, diff --git a/moonstreamapi/moonstreamapi/settings.py b/moonstreamapi/moonstreamapi/settings.py index c3a93170..fa32fa0c 100644 --- a/moonstreamapi/moonstreamapi/settings.py +++ b/moonstreamapi/moonstreamapi/settings.py @@ -17,7 +17,7 @@ brood_api_url=BUGOUT_BROOD_URL, spire_api_url=BUGOUT_SPIRE_EXTERNAL_URL ) -BUGOUT_REQUEST_TIMEOUT_SECONDS = 5 +BUGOUT_REQUEST_TIMEOUT_SECONDS = 10 HUMBUG_REPORTER_BACKEND_TOKEN = os.environ.get("HUMBUG_REPORTER_BACKEND_TOKEN") From bc0627e1402d0ddd7b2be3972d67a751b69454c1 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 7 Aug 2024 16:07:39 +0300 Subject: [PATCH 2/2] Add changes. --- moonstreamapi/moonstreamapi/routes/subscriptions.py | 1 + moonstreamapi/moonstreamapi/version.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/moonstreamapi/moonstreamapi/routes/subscriptions.py b/moonstreamapi/moonstreamapi/routes/subscriptions.py index 7b8a23b6..d2f76aa0 100644 --- a/moonstreamapi/moonstreamapi/routes/subscriptions.py +++ b/moonstreamapi/moonstreamapi/routes/subscriptions.py @@ -587,6 +587,7 @@ async def update_subscriptions_handler( ), required_fields=update_required_fields, secondary_fields=update_secondary_fields, + timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS, ) except Exception as e: logger.error(f"Error update user subscriptions: {str(e)}") diff --git a/moonstreamapi/moonstreamapi/version.py b/moonstreamapi/moonstreamapi/version.py index 9d9a48ba..9a164689 100644 --- a/moonstreamapi/moonstreamapi/version.py +++ b/moonstreamapi/moonstreamapi/version.py @@ -2,4 +2,4 @@ Moonstream library and API version. """ -MOONSTREAMAPI_VERSION = "0.4.7" +MOONSTREAMAPI_VERSION = "0.4.8"