avoid crash on spurious empty file in the pending_notifications dir

This commit is contained in:
adbenitez
2025-04-29 16:51:10 +02:00
committed by holger krekel
parent 0638bea363
commit b35e84e479

View File

@@ -95,7 +95,12 @@ class Notifier:
logging.warning(f"removing spurious queue item: {queue_path!r}")
queue_path.unlink()
continue
queue_item = PersistentQueueItem.read_from_path(queue_path)
try:
queue_item = PersistentQueueItem.read_from_path(queue_path)
except ValueError:
logging.warning(f"removing spurious queue item: {queue_path!r}")
queue_path.unlink()
continue
self.queue_for_retry(queue_item)
def queue_for_retry(self, queue_item, retry_num=0):