Skip to content

Commit a19df04

Browse files
committed
Do not attempt to deal with limited retention for alias storages locally
1 parent 04e74bc commit a19df04

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/apify/storage_clients/_apify/_storage_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import logging
34
from asyncio import Lock
45
from 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

src/apify/storage_clients/_apify/_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import base64
4+
import logging
45
from logging import getLogger
56
from 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

0 commit comments

Comments
 (0)