From 269a731b6f74a4375b61b59ed964e1c5aa0d5d57 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com> Date: Mon, 27 Feb 2017 13:39:46 +0000 Subject: [PATCH] content_archive_add: Use the right 'missing' status Related: T494 --- swh/storage/archiver/db.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/swh/storage/archiver/db.py b/swh/storage/archiver/db.py index 30b4e3f79..2b348291c 100644 --- a/swh/storage/archiver/db.py +++ b/swh/storage/archiver/db.py @@ -244,6 +244,12 @@ class ArchiverDb(BaseDb): def content_archive_add( 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): content_id = '\\x%s' % hashutil.hash_to_hex(content_id) @@ -259,7 +265,7 @@ class ArchiverDb(BaseDb): for source in sources_missing: copies[source] = { - "status": "absent", + "status": "missing", } query = """INSERT INTO content_archive(content_id, copies, num_present) -- GitLab