Skip to content

Commit 730262e

Browse files
authored
Merge pull request #2662 from Drakkar-Software/dev
dev merge
2 parents ca60e8e + 4081632 commit 730262e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

octobot/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ async def _get_authenticated_community_if_possible(config, logger):
171171
if not community_auth.is_initialized():
172172
# try with saved credentials if any
173173
has_tentacles = tentacles_manager_api.is_tentacles_architecture_valid()
174-
# When no tentacles, fetch private data. Otherwise fetch it later on in bot init
175-
await community_auth.async_init_account(fetch_private_data=not has_tentacles)
174+
# When no tentacles or in cloud, fetch private data. Otherwise fetch it later on in bot init
175+
fetch_private_data = not has_tentacles or constants.IS_CLOUD_ENV
176+
await community_auth.async_init_account(fetch_private_data=fetch_private_data)
176177
except authentication.FailedAuthentication as err:
177178
logger.error(f"Failed authentication when initializing community authenticator: {err}")
178179
except Exception as err:

octobot/community/authentication.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,15 @@ async def fetch_private_data(self, reset=False):
555555
except Exception as err:
556556
self.logger.exception(err, True, f"Unexpected error when fetching package urls: {err}")
557557
finally:
558+
if self._fetched_private_data is None:
559+
self._fetched_private_data = asyncio.Event()
558560
self._fetched_private_data.set()
559561
if self.has_open_source_package():
560562
# fetch indexes as well
561563
await self._refresh_products()
562564

563565
async def _fetch_package_urls(self, mqtt_uuid: typing.Optional[str]) -> (list[str], str):
566+
self.logger.debug(f"Fetching package")
564567
resp = await self.supabase_client.http_get(
565568
constants.COMMUNITY_EXTENSIONS_CHECK_ENDPOINT,
566569
headers={
@@ -570,6 +573,7 @@ async def _fetch_package_urls(self, mqtt_uuid: typing.Optional[str]) -> (list[st
570573
params={"mqtt_id": mqtt_uuid} if mqtt_uuid else {},
571574
timeout=constants.COMMUNITY_FETCH_TIMEOUT
572575
)
576+
self.logger.debug("Fetched package")
573577
resp.raise_for_status()
574578
json_resp = json.loads(resp.json().get("message", {}))
575579
if not json_resp:

0 commit comments

Comments
 (0)