From 24da26959d59e8d8390a5dd623282f0fef8cd12f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:44:58 -0800 Subject: [PATCH] Update consumer.py --- src/documents/consumer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 66f509aff..ad5ca2b1d 100644 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -176,7 +176,8 @@ class ConsumerPluginMixin: self.log.error(log_message or message, exc_info=exc_info) # Move the file to the failed directory if self.input_doc.original_file.exists(): - self.input_doc.original_file.rename( + copy_file_with_basic_stats( + self.input_doc.original_file, settings.CONSUMPTION_FAILED_DIR / self.input_doc.original_file.name, ) raise ConsumerError(f"{self.filename}: {log_message or message}") from exception