Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
classifier cache timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaswinkler committed Feb 6, 2021
1 parent ffe96c8 commit 7702f50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/documents/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def load_classifier():
classifier = DocumentClassifier()
try:
classifier.load()
cache.set("paperless-classifier", classifier, version=version)
cache.set("paperless-classifier", classifier,
version=version, timeout=86400)
except (EOFError, IncompatibleClassifierVersionError) as e:
# there's something wrong with the model file.
logger.error(
Expand Down

0 comments on commit 7702f50

Please sign in to comment.