FileManager¶
Business logic for file operations in file_service/services/file_manager.py.
Key methods¶
File CRUD¶
await upload_file(owner_id, file: UploadFile, collection=None) -> UserFile
data_store/{owner_id}/, creates UserFile DB record. For temporal collections, stores in _temporal_{stem}/ subdirectory.
await delete_file(file_id) -> None
await reupload_file(file_id, file: UploadFile) -> UserFile
await get_user_files(owner_id) -> list[UserFile]
Workspace management¶
await link_files_to_room(room_id, file_ids: list[UUID]) -> None
RoomDataRef records. Additive — does not remove existing links.
await apply_files_to_room(room_id) -> None
specifications.xml and metadata.json from linked files. Triggers Choregraph build if a pipeline definition exists.
await unlink_file(room_id, file_id) -> None
RoomDataRef record.
Helpers¶
linkable_filenames(user_file: UserFile) -> list[str]
temporal_subdir(user_file: UserFile) -> str
Per-room locking¶
Link/unlink/apply operations acquire an async lock per room_id to prevent concurrent workspace modifications.