feat: add local mock storage service for development#18
Merged
Conversation
3284b12 to
cd961c5
Compare
* Uses a mounted folder to store uploads in the `.data` directory * This removes the dependency on S3 locally
cd961c5 to
34cf394
Compare
RichJackson
reviewed
Nov 3, 2025
| async def delete(cls, key: str) -> None: | ||
| with suppress(FileNotFoundError): | ||
| storage_path = Path(settings.LOCAL_STORAGE_PATH) / key | ||
| storage_path.unlink() |
Contributor
There was a problem hiding this comment.
two things:
- you can use
.unlink(missing_ok=True)instead ofsuppress - I wonder if we need a little bit more robustness in how we delete these files, given that it may have data protection implications/cause stability issues with disk space if running on bare metal (similar to how we have back up policies to delete files after a certain age on s3). For instance, if the file is in use, it may not be deleted. We could add a check on the clean up scheduler? It's probably overkill since you would almost certainly want managed storage in prod, so perhaps it's enough to just log a warning about the potential implications when using this service?
Collaborator
Author
There was a problem hiding this comment.
This definitely wasn't written with actually using it in production in mind, but I suppose it would work if you were running everything on the same box or with a volume mounted same as in docker compose. I'll add a log saying we recommend only using this for dev
RichJackson
reviewed
Nov 3, 2025
RichJackson
left a comment
Contributor
There was a problem hiding this comment.
looks good - left a couple of notes for consideration
…g mock storage in prod
RichJackson
approved these changes
Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.data/directory