Skip to content
Snippets Groups Projects
Commit 343c5302 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

content_archive_add: Use the right 'missing' status

Related: T494
parent 01f4de3e
No related branches found
No related tags found
No related merge requests found
...@@ -244,6 +244,12 @@ class ArchiverDb(BaseDb): ...@@ -244,6 +244,12 @@ class ArchiverDb(BaseDb):
def content_archive_add( def content_archive_add(
self, content_id, sources_present, sources_missing, cur=None): self, content_id, sources_present, sources_missing, cur=None):
"""Add content archive entry for the content content_id.
The status is:
- present for all sources in sources_present.
- missing for all sources in sources_missing.
"""
if isinstance(content_id, bytes): if isinstance(content_id, bytes):
content_id = '\\x%s' % hashutil.hash_to_hex(content_id) content_id = '\\x%s' % hashutil.hash_to_hex(content_id)
...@@ -259,7 +265,7 @@ class ArchiverDb(BaseDb): ...@@ -259,7 +265,7 @@ class ArchiverDb(BaseDb):
for source in sources_missing: for source in sources_missing:
copies[source] = { copies[source] = {
"status": "absent", "status": "missing",
} }
query = """INSERT INTO content_archive(content_id, copies, num_present) query = """INSERT INTO content_archive(content_id, copies, num_present)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment