Skip to content

Commit

Permalink
Prevent dummy profiles on start up (#3449)
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale authored Jan 17, 2025
1 parent 8b83b9e commit eb8ee9f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion acapy_agent/utils/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ..askar.profile_anon import AskarAnoncredsProfile
from ..core.profile import Profile
from ..multitenant.manager import MultitenantManager
from ..multitenant.single_wallet_askar_manager import SingleWalletAskarMultitenantManager
from ..storage.base import BaseStorageSearch
from ..wallet.models.wallet_record import WalletRecord

Expand Down Expand Up @@ -41,6 +42,13 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
search_session = base_storage_search.search_records(
type_filter=WalletRecord.RECORD_TYPE, page_size=10
)
if (
root_profile.context.settings.get("multitenant.wallet_type")
== "single-wallet-askar"
):
manager = SingleWalletAskarMultitenantManager(root_profile)
else:
manager = MultitenantManager(root_profile)
while search_session._done is False:
wallet_storage_records = await search_session.fetch()
for wallet_storage_record in wallet_storage_records:
Expand All @@ -49,7 +57,7 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
json.loads(wallet_storage_record.value),
)
subwallet_profiles.append(
await MultitenantManager(root_profile).get_wallet_profile(
await manager.get_wallet_profile(
base_context=root_profile.context,
wallet_record=wallet_record,
)
Expand Down

0 comments on commit eb8ee9f

Please sign in to comment.