DELETE /artifacts/{digest}: superuser only, 409 while referenced
The keep-set the hourly sweep uses is now referenced_artifacts, shared by the sweep and the route. The volatile ring is not touched.
This commit is contained in:
@@ -160,6 +160,19 @@ class ArtifactStore:
|
||||
self.put_file(source)
|
||||
return True
|
||||
|
||||
def delete(self, digest: str) -> bool:
|
||||
"""Remove one artifact's bytes. Returns whether this store had them.
|
||||
|
||||
The ring is not looked in: its frames fall out on their own.
|
||||
"""
|
||||
if not valid_digest(digest):
|
||||
return False
|
||||
try:
|
||||
self._path(digest).unlink()
|
||||
except FileNotFoundError:
|
||||
return False
|
||||
return True
|
||||
|
||||
def read(self, digest: str) -> Iterator[bytes]:
|
||||
target = self.path(digest)
|
||||
if target is None:
|
||||
|
||||
Reference in New Issue
Block a user