Add FileWorker.delete() method #9

Closed
opened 2026-05-03 10:09:09 +00:00 by gravityfargo · 0 comments
Owner

Context

Filed in support of athena-archive-api #81 (couple BE tightly with athena-file). The BE currently bypasses athena-file for file deletion — `Path.unlink()` directly in `routers/media/delete.py` and a custom `_remove_dir()` recursive helper in `routers/media/utils.py`. Routing those through athena-file would let the library maintain hash/index consistency on delete.

Plan

Add `FileWorker.delete()` that:

  • Removes the underlying file
  • Hash properties become invalid afterwards (document this clearly)
  • Returns `bool` (True if file existed and was removed)
  • Optionally: notifies `FileArchiver` / `ShardedJSONStorage` so any indices stay consistent (or leave that to a higher-level wrapper)

Acceptance criteria

  • `FileWorker.delete()` exists and is tested
  • Documented that calling `delete()` invalidates the worker
## Context Filed in support of athena-archive-api #81 (couple BE tightly with athena-file). The BE currently bypasses athena-file for file deletion — \`Path.unlink()\` directly in \`routers/media/delete.py\` and a custom \`_remove_dir()\` recursive helper in \`routers/media/utils.py\`. Routing those through athena-file would let the library maintain hash/index consistency on delete. ## Plan Add \`FileWorker.delete()\` that: - Removes the underlying file - Hash properties become invalid afterwards (document this clearly) - Returns \`bool\` (True if file existed and was removed) - Optionally: notifies \`FileArchiver\` / \`ShardedJSONStorage\` so any indices stay consistent (or leave that to a higher-level wrapper) ## Acceptance criteria - [ ] \`FileWorker.delete()\` exists and is tested - [ ] Documented that calling \`delete()\` invalidates the worker
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ModernLeft/athena-file#9
No description provided.