harp_apps.storage.services.blob_storages.redis¶
- class RedisBlobStorage[source]¶
Bases:
IBlobStorage- async delete_blobs(blobs)[source]¶
Delete each blob, unless it was stored again with other data since it was read.
- async delete_stale(blob_ids, /, *, older_than)[source]¶
Delete the given blobs, except those written after older_than. Returns how many were deleted.
- BLOB_PREFIX = 'harp:blob:'¶
Every blob lives at
<prefix><blob id>: the Redis database may be shared with other applications, whose keys HARP never lists or sweeps. Blobs stored before the prefix existed sit under their bare id (a 40 or 64 character hexdigest): they are still read and deleted by id, but never listed.
- WRITE_MARKER_PREFIX = 'harp:blob-written:'¶
Marks a blob as recently written: key
<prefix><blob id>, holding the write time, living ORPHAN_GRACE. Redis blobs have nocreated_at; the marker is what keeps the janitor from deleting content whose message is not committed yet, asblobs.created_atdoes for SQL.