MCPcopy Create free account
hub / github.com/apify/crawlee-python / set_storage_client

Method set_storage_client

src/crawlee/_service_locator.py:106–121  ·  view source on GitHub ↗

Set the storage client. Args: storage_client: The storage client to set. Raises: ServiceConflictError: If the storage client has already been retrieved before.

(self, storage_client: StorageClient)

Source from the content-addressed store, hash-verified

104 return self._storage_client
105
106 def set_storage_client(self, storage_client: StorageClient) -> None:
107 """Set the storage client.
108
109 Args:
110 storage_client: The storage client to set.
111
112 Raises:
113 ServiceConflictError: If the storage client has already been retrieved before.
114 """
115 if self._storage_client is storage_client:
116 # Same instance, no need to anything
117 return
118 if self._storage_client:
119 raise ServiceConflictError(StorageClient, storage_client, self._storage_client)
120
121 self._storage_client = storage_client
122
123 @property
124 def storage_instance_manager(self) -> StorageInstanceManager:

Calls 1