Add build_full_path method to LocalStorageService and stub method to StorageService

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-30 17:17:36 -03:00
commit 42356fc379
2 changed files with 7 additions and 0 deletions

View file

@ -15,6 +15,10 @@ class LocalStorageService(StorageService):
self.data_dir = Path(settings_service.settings.CONFIG_DIR)
self.set_ready()
def build_full_path(self, flow_id: str, file_name: str) -> str:
"""Build the full path of a file in the local storage."""
return str(self.data_dir / flow_id / file_name)
async def save_file(self, flow_id: str, file_name: str, data: bytes):
"""
Save a file in the local storage.

View file

@ -16,6 +16,9 @@ class StorageService(Service):
self.session_service = session_service
self.set_ready()
def build_full_path(self, flow_id: str, file_name: str) -> str:
pass
def set_ready(self):
self.ready = True