During a pairing session between me and @dwinston today (PT), we noticed that the nmdc database in the MongoDB server in the dev environment had several collections whose names had the format:
_runtime.tmp.linked_instances.{short_hex_str}.{long_hex_str}
Those were created by the /nmdcschema/linked_instances API endpoint.
|
def temp_linked_instances_collection_name(ids: list[str], types: list[str]) -> str: |
|
"""A name for a temporary mongo collection to store linked instances in service of an API request.""" |
|
return f"_runtime.tmp.linked_instances.{hash_from_ids_and_types(ids=ids,types=types)}.{ObjectId()}" |
This ticket is about:
- Deleting those collections from the database
- Ensuring the Runtime automatically cleans up those collections in the database in the future