File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
src/apify/storage_clients/_apify Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import logging
34from asyncio import Lock
45from typing import TYPE_CHECKING
56
@@ -118,6 +119,13 @@ async def _initialize_alias_storages(cls) -> None:
118119 This method is called once to populate storage_instance_manager alias related cache. All existing alias
119120 storages are saved in storage_instance_manager cache. If the alias storage is not there, it does not exist yet.
120121 """
122+ if not Configuration .get_global_configuration ().is_at_home :
123+ logging .getLogger (__name__ ).warning (
124+ 'Alias storage limited retention is only supported on Apify platform. '
125+ 'No pre-existing storages are imported.'
126+ )
127+ return
128+
121129 async with cls .get_alias_init_lock ():
122130 if cls ._alias_storages_initialized :
123131 return
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import base64
4+ import logging
45from logging import getLogger
56from typing import TYPE_CHECKING
67
@@ -89,6 +90,12 @@ def _create_fernet(token: str) -> Fernet:
8990 return Fernet (base64 .urlsafe_b64encode (token_32 ))
9091
9192 async def store_mapping_to_apify_kvs (self , storage_id : str ) -> None :
93+ if not Configuration .get_global_configuration ().is_at_home :
94+ logging .getLogger (__name__ ).warning (
95+ 'Alias storage limited retention is only supported on Apify platform. Storage is not exported.'
96+ )
97+ return
98+
9299 default_kvs_client = await self .get_default_kvs_client ()
93100 await default_kvs_client .get ()
94101
You can’t perform that action at this time.
0 commit comments