diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 480537279..134137e2f 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -252,8 +252,6 @@ class Consumer(LoggingMixin): self.log("debug", "Deleting file {}".format(self.path)) os.unlink(self.path) - self.run_post_consume_script(document) - except Exception as e: self.log( "error", @@ -264,6 +262,8 @@ class Consumer(LoggingMixin): finally: document_parser.cleanup() + self.run_post_consume_script(document) + self.log( "info", "Document {} consumption finished".format(document)