diff --git a/octobot/cli.py b/octobot/cli.py index a4cad862a..adb4ef8e6 100644 --- a/octobot/cli.py +++ b/octobot/cli.py @@ -171,8 +171,9 @@ async def _get_authenticated_community_if_possible(config, logger): if not community_auth.is_initialized(): # try with saved credentials if any has_tentacles = tentacles_manager_api.is_tentacles_architecture_valid() - # When no tentacles, fetch private data. Otherwise fetch it later on in bot init - await community_auth.async_init_account(fetch_private_data=not has_tentacles) + # When no tentacles or in cloud, fetch private data. Otherwise fetch it later on in bot init + fetch_private_data = not has_tentacles or constants.IS_CLOUD_ENV + await community_auth.async_init_account(fetch_private_data=fetch_private_data) except authentication.FailedAuthentication as err: logger.error(f"Failed authentication when initializing community authenticator: {err}") except Exception as err: diff --git a/octobot/community/authentication.py b/octobot/community/authentication.py index 6b8d764f3..144286cc3 100644 --- a/octobot/community/authentication.py +++ b/octobot/community/authentication.py @@ -555,12 +555,15 @@ async def fetch_private_data(self, reset=False): except Exception as err: self.logger.exception(err, True, f"Unexpected error when fetching package urls: {err}") finally: + if self._fetched_private_data is None: + self._fetched_private_data = asyncio.Event() self._fetched_private_data.set() if self.has_open_source_package(): # fetch indexes as well await self._refresh_products() async def _fetch_package_urls(self, mqtt_uuid: typing.Optional[str]) -> (list[str], str): + self.logger.debug(f"Fetching package") resp = await self.supabase_client.http_get( constants.COMMUNITY_EXTENSIONS_CHECK_ENDPOINT, headers={ @@ -570,6 +573,7 @@ async def _fetch_package_urls(self, mqtt_uuid: typing.Optional[str]) -> (list[st params={"mqtt_id": mqtt_uuid} if mqtt_uuid else {}, timeout=constants.COMMUNITY_FETCH_TIMEOUT ) + self.logger.debug("Fetched package") resp.raise_for_status() json_resp = json.loads(resp.json().get("message", {})) if not json_resp: