diff --git a/docutranslate/cacher/document_cacher.py b/docutranslate/cacher/document_cacher.py index 0805765..6e78983 100644 --- a/docutranslate/cacher/document_cacher.py +++ b/docutranslate/cacher/document_cacher.py @@ -1,5 +1,8 @@ +import os + from docutranslate.converter import Document +# DOCUTRANSLATE_CHACHE_NUM=os.getenv("DOCUTRANSLATE_CHACHE_NUM") class DocumentCacher: def __init__(self): @@ -17,5 +20,8 @@ class DocumentCacher: self.cache_dict[hash_code] = result return result + def clear(self): + self.cache_dict.clear() + document_cacher_global = DocumentCacher()