Skip to content

Commit

Permalink
Add comment and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Jan 19, 2022
1 parent 590ffd4 commit 09f0ebd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/maggma/stores/aws.py
Expand Up @@ -379,7 +379,10 @@ def write_doc_to_s3(self, doc: Dict, search_keys: List[str]):
to_isoformat_ceil_ms(doc[self.last_updated_field])
)

# keep a record of original keys, in case these are important for the individual researcher
# it is not expected that this information will be used except in disaster recovery
search_doc["s3-to-mongo-keys"] = {k: self._sanitize_key(k) for k in search_doc.keys()}
search_doc["s3-to-mongo-keys"]["s3-to-mongo-keys"] = "s3-to-mongo-keys" # inception
s3_bucket.put_object(
Key=self.sub_dir + str(doc[self.key]),
Body=data,
Expand Down

0 comments on commit 09f0ebd

Please sign in to comment.