Fix: Clear metadata cache when the filename(s) change (#5957)

* Update doc modified time upon move and rename

* Clear the cached metadata if the filename(s) have been changed

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Trenton H
2024-02-29 10:34:15 -08:00
committed by GitHub
parent af16bb3934
commit c57c1d5389
2 changed files with 8 additions and 0 deletions

View File

@@ -189,6 +189,11 @@ def refresh_metadata_cache(
cache.touch(doc_key, timeout)
def clear_metadata_cache(document_id: int) -> None:
doc_key = get_metadata_cache_key(document_id)
cache.delete(doc_key)
def get_thumbnail_modified_key(document_id: int) -> str:
"""
Builds the key to store a thumbnail's timestamp