diff --git a/octobot/community/community_bot.py b/octobot/community/community_bot.py index 9e0eec0c5..fba607c34 100644 --- a/octobot/community/community_bot.py +++ b/octobot/community/community_bot.py @@ -88,6 +88,11 @@ async def should_trade_according_to_products_subscription_and_deployment_error_s ): # bot should be running and didn't trigger stop condition yet return True + self.get_logger().warning( + f"Bot {self.authenticator.user_account.bot_id} should not trade: " + f"products_subscription_desired_status={products_subscription[supabase_enums.ProductsSubscriptionsKeys.DESIRED_STATUS.value]}, " + f"deployment_error_status={self.authenticator.user_account.get_selected_bot_deployment_error_status()}" + ) return False async def on_started_bot(self): @@ -165,8 +170,10 @@ def _is_new_bot(self) -> bool: def _is_product_subscription_desired_status_active(self, products_subscription: dict) -> bool: return ( - products_subscription[supabase_enums.ProductsSubscriptionsKeys.DESIRED_STATUS.value] - == supabase_enums.ProductSubscriptionDesiredStatus.ACTIVE.value + products_subscription[supabase_enums.ProductsSubscriptionsKeys.DESIRED_STATUS.value] in ( + supabase_enums.ProductSubscriptionDesiredStatus.ACTIVE.value, + supabase_enums.ProductSubscriptionDesiredStatus.RESTARTING.value, + ) ) def _is_deployment_error_status_in( diff --git a/octobot/community/supabase_backend/community_supabase_client.py b/octobot/community/supabase_backend/community_supabase_client.py index 9c9537a88..3c5a3c035 100644 --- a/octobot/community/supabase_backend/community_supabase_client.py +++ b/octobot/community/supabase_backend/community_supabase_client.py @@ -51,10 +51,10 @@ import octobot.community.supabase_backend.configuration_storage as configuration_storage import octobot.community.identifiers_provider as identifiers_provider -# Experimental to prevent httpx.PoolTimeout + _INTERNAL_LOGGERS = [ - # "httpx", "httpx._client", - # "httpcore.http11", "httpcore.http2", "httpcore.proxy", "httpcore.socks", "httpcore.connection" + "httpx", "asyncio", + "httpcore.http11", "httpcore.connection", ] # disable httpx info logs as it logs every request commons_logging.set_logging_level(_INTERNAL_LOGGERS, logging.WARNING) diff --git a/octobot/community/supabase_backend/enums.py b/octobot/community/supabase_backend/enums.py index f27ddb412..c7d636d21 100644 --- a/octobot/community/supabase_backend/enums.py +++ b/octobot/community/supabase_backend/enums.py @@ -85,6 +85,8 @@ class BotDeploymentStatus(enum.Enum): class ProductSubscriptionDesiredStatus(enum.Enum): ACTIVE = 'active' CANCELED = "canceled" + RESTARTING = "restarting" + STOPPING = "stopping" class BotDeploymentErrorsStatuses(enum.Enum):