Clean up the logging

This commit is contained in:
Trenton Holmes 2025-01-19 11:08:33 -08:00
parent a5822c212d
commit 0793c8b35e

View File

@ -219,22 +219,11 @@ class DocumentClassifier:
labels_tags_unique = {tag for tags in labels_tags for tag in tags}
num_tags = len(labels_tags_unique)
latest_doc_change = docs_queryset.latest("modified").modified
logger.debug(
f"""Found:
Last training: {self.last_doc_change_time}
Latest doc change: {latest_doc_change}
Last auto type hash: {self.last_auto_type_hash.hex() if self.last_auto_type_hash else None}
Current hash: {hasher.digest().hex()}
Result: Retraining required
""",
)
# Check if retraining is actually required.
# A document has been updated since the classifier was trained
# New auto tags, types, correspondent, storage paths exist
latest_doc_change = docs_queryset.latest("modified").modified
if (
self.last_doc_change_time is not None
and self.last_doc_change_time >= latest_doc_change