mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
refactor(storage): integrate SilentStorage for improved file handling
- Replaced direct storage references with SilentStorage in various components to enhance fallback mechanisms. - Updated storage key formats for sandbox archives and files to improve clarity and consistency. - Refactored related classes and methods to utilize the new SandboxFilePath structure. - Adjusted unit tests to reflect changes in the StorageTicket model and its serialization methods.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
"""Storage wrapper that caches presigned download URLs."""
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from extensions.ext_redis import redis_client
|
||||
from extensions.storage.base_storage import BaseStorage
|
||||
from extensions.storage.storage_wrapper import StorageWrapper
|
||||
|
||||
@@ -17,7 +17,7 @@ class CachedPresignStorage(StorageWrapper):
|
||||
|
||||
Example:
|
||||
cached_storage = CachedPresignStorage(
|
||||
storage=FilePresignStorage(base_storage),
|
||||
storage=FilePresignStorage(SilentStorage(base_storage)),
|
||||
redis_client=redis_client,
|
||||
cache_key_prefix="app_asset:draft_download",
|
||||
)
|
||||
@@ -30,7 +30,6 @@ class CachedPresignStorage(StorageWrapper):
|
||||
def __init__(
|
||||
self,
|
||||
storage: BaseStorage,
|
||||
redis_client: Any,
|
||||
cache_key_prefix: str = "presign_cache",
|
||||
):
|
||||
super().__init__(storage)
|
||||
|
||||
Reference in New Issue
Block a user