mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
refactor all
This commit is contained in:
@ -2,9 +2,24 @@ from __future__ import annotations
|
||||
|
||||
from core.sandbox.entities.files import SandboxFileDownloadTicket, SandboxFileNode
|
||||
from core.sandbox.inspector import SandboxFileBrowser
|
||||
from extensions.ext_storage import storage
|
||||
from extensions.storage.cached_presign_storage import CachedPresignStorage
|
||||
from extensions.storage.file_presign_storage import FilePresignStorage
|
||||
|
||||
|
||||
class SandboxFileService:
|
||||
@staticmethod
|
||||
def get_storage() -> CachedPresignStorage:
|
||||
"""Get a lazily-initialized storage instance for sandbox files.
|
||||
|
||||
Returns a CachedPresignStorage wrapping FilePresignStorage,
|
||||
providing presign fallback and URL caching.
|
||||
"""
|
||||
return CachedPresignStorage(
|
||||
storage=FilePresignStorage(storage.storage_runner),
|
||||
cache_key_prefix="sandbox_files",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def list_files(
|
||||
cls,
|
||||
|
||||
Reference in New Issue
Block a user