From 85c661dff26949a5ae3d7988aeb31d1d0b797e57 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 64ae1fba9..25dee5daf 100644 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -150,7 +150,8 @@ class ConsumerPlugin( 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