File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
src/apify/storage_clients/_smart_apify Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -118,13 +118,13 @@ async def main():
118
118
119
119
``` python
120
120
from crawlee import service_locator
121
- from apify.storage_clients import ApifyStorageClient, ApifyHybridStorageClient , MemoryStorageClient
121
+ from apify.storage_clients import ApifyStorageClient, SmartApifyStorageClient , MemoryStorageClient
122
122
from apify import Actor
123
123
124
124
125
125
async def main ():
126
126
service_locator.set_storage_client(
127
- ApifyHybridStorageClient (
127
+ SmartApifyStorageClient (
128
128
cloud_storage_client = ApifyStorageClient(request_queue_access = " single" ),
129
129
local_storage_client = MemoryStorageClient()
130
130
)
@@ -143,13 +143,17 @@ async def main():
143
143
144
144
``` python
145
145
from crawlee import service_locator
146
- from apify.storage_clients import ApifyStorageClient
146
+ from apify.storage_clients import ApifyStorageClient, SmartApifyStorageClient
147
147
from apify import Actor
148
148
149
149
150
150
async def main ():
151
151
# Full client that supports multiple consumers of the Apify Request Queue
152
- service_locator.set_storage_client(ApifyStorageClient(request_queue_access = " shared" ))
152
+ service_locator.set_storage_client(
153
+ SmartApifyStorageClient(
154
+ cloud_storage_client = ApifyStorageClient(request_queue_access = " shared" ),
155
+ )
156
+ )
153
157
async with Actor:
154
158
rq = await Actor.open_request_queue()
155
159
```
Original file line number Diff line number Diff line change 21
21
class SmartApifyStorageClient (StorageClient ):
22
22
"""SmartApifyStorageClient that delegates to cloud_storage_client or local_storage_client.
23
23
24
- When running on Apify platform use cloud_storage_client, else use local_storage_client. It has additional wrapper
25
- methods with `force_cloud` parameter to force using cloud_storage_client when opening specific storages even when
26
- not running on the Apify platform. This storage client is designed to work specifically in Actor context.
24
+ When running on Apify platform use cloud_storage_client, else use local_storage_client. This storage client is
25
+ designed to work specifically in Actor context.
27
26
"""
28
27
29
28
def __init__ (
You can’t perform that action at this time.
0 commit comments