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 1
1
from __future__ import annotations
2
2
3
+ import logging
3
4
from asyncio import Lock
4
5
from typing import TYPE_CHECKING
5
6
@@ -118,6 +119,13 @@ async def _initialize_alias_storages(cls) -> None:
118
119
This method is called once to populate storage_instance_manager alias related cache. All existing alias
119
120
storages are saved in storage_instance_manager cache. If the alias storage is not there, it does not exist yet.
120
121
"""
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
+
121
129
async with cls .get_alias_init_lock ():
122
130
if cls ._alias_storages_initialized :
123
131
return
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import base64
4
+ import logging
4
5
from logging import getLogger
5
6
from typing import TYPE_CHECKING
6
7
@@ -89,6 +90,12 @@ def _create_fernet(token: str) -> Fernet:
89
90
return Fernet (base64 .urlsafe_b64encode (token_32 ))
90
91
91
92
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
+
92
99
default_kvs_client = await self .get_default_kvs_client ()
93
100
await default_kvs_client .get ()
94
101
You can’t perform that action at this time.
0 commit comments