fix: add error handling for file not found error
When a file couldn't be downloaded from storage, the queue consumer now informs the operator with a log and rejects the message, without crashing but continuing its honest work.
This commit is contained in:
parent
876253b3fb
commit
021222475b
@ -184,6 +184,9 @@ class QueueManager:
|
||||
|
||||
channel.basic_ack(delivery_tag=method.delivery_tag)
|
||||
logger.debug(f"Message with {method.delivery_tag=} acknowledged.")
|
||||
except FileNotFoundError as e:
|
||||
logger.warning(f"{e}, declining message with {method.delivery_tag=}.")
|
||||
channel.basic_nack(method.delivery_tag, requeue=False)
|
||||
except Exception:
|
||||
logger.warning(f"Failed to process message with {method.delivery_tag=}, declining...", exc_info=True)
|
||||
channel.basic_nack(method.delivery_tag, requeue=False)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user