Skip to content

Commit

Permalink
[Community] add package check key
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jul 5, 2024
1 parent ec9493c commit d37ab96
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion octobot/community/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ async def wait_for_private_data_fetch_if_processing(self):
await self.wait_for_login_if_processing()
if self.is_logged_in() and self._fetched_private_data is not None and not self._fetched_private_data.is_set():
# ensure login details have been fetched
await asyncio.wait_for(self._fetched_private_data.wait(), constants.COMMUNITY_FETCH_TIMEOUT)
await asyncio.wait_for(
self._fetched_private_data.wait(),
supabase_backend.HTTP_RETRY_COUNT * constants.COMMUNITY_FETCH_TIMEOUT
)

def can_authenticate(self):
return bool(
Expand Down
2 changes: 2 additions & 0 deletions octobot/community/supabase_backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from octobot.community.supabase_backend import community_supabase_client
from octobot.community.supabase_backend.community_supabase_client import (
CommunitySupabaseClient,
HTTP_RETRY_COUNT,
)

__all__ = [
Expand All @@ -38,4 +39,5 @@
"ASyncConfigurationStorage",
"AuthenticatedAsyncSupabaseClient",
"CommunitySupabaseClient",
"HTTP_RETRY_COUNT",
]
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ async def httpx_retrier_wrapper(*args, **kwargs):
# waking up, retry
error = "bad gateway"
else:
if i > 0:
commons_logging.get_logger(__name__).debug(
f"{f.__name__}(args={args[1:]}) succeeded after {i+1} attempts"
)
return resp
except httpx.ReadTimeout as err:
error = f"{err} ({err.__class__.__name__})"
Expand Down
2 changes: 1 addition & 1 deletion octobot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"COMMUNITY_EXTENSIONS_CHECK_ENDPOINT", "https://premium.octobot.cloud"
)
COMMUNITY_EXTENSIONS_CHECK_ENDPOINT_KEY = os.getenv(
"COMMU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