(
self,
base_dir: Path,
*,
max_attachment_bytes: int = 25 * 1024 * 1024,
max_session_attachment_bytes: int = 100 * 1024 * 1024,
)
| 14 | |
| 15 | class AttachmentCache: |
| 16 | def __init__( |
| 17 | self, |
| 18 | base_dir: Path, |
| 19 | *, |
| 20 | max_attachment_bytes: int = 25 * 1024 * 1024, |
| 21 | max_session_attachment_bytes: int = 100 * 1024 * 1024, |
| 22 | ): |
| 23 | self.base_dir = base_dir |
| 24 | self.max_attachment_bytes = max_attachment_bytes |
| 25 | self.max_session_attachment_bytes = max_session_attachment_bytes |
| 26 | self.base_dir.mkdir(parents=True, exist_ok=True) |
| 27 | |
| 28 | def session_dir(self, session_key: str) -> Path: |
| 29 | directory = self.base_dir / session_key / "attachments" |
nothing calls this directly
no outgoing calls
no test coverage detected