Skip to content

Commit

Permalink
Merge pull request #363 from ianco/fix_retry_logs
Browse files Browse the repository at this point in the history
Fix logging on http retries
  • Loading branch information
andrewwhitehead authored Feb 6, 2020
2 parents 500b678 + 1402026 commit 339ce1f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aries_cloudagent/transport/outbound/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,17 @@ def finished_deliver(self, queued: QueuedOutboundMessage, completed: CompletedTa
"""Handle completion of queued message delivery."""
if completed.exc_info:
queued.error = completed.exc_info
LOGGER.exception(
"Outbound message could not be delivered", exc_info=queued.error,
)

if queued.retries:
LOGGER.error(">>> Posting error; Re-queue failed message ...")
queued.retries -= 1
queued.state = QueuedOutboundMessage.STATE_RETRY
queued.retry_at = time.perf_counter() + 10
else:
LOGGER.exception(
"Outbound message could not be delivered", exc_info=queued.error,
)
LOGGER.error(">>> NOT Re-queued, state is DONE, failed to deliver msg.")
queued.state = QueuedOutboundMessage.STATE_DONE
else:
queued.error = None
Expand Down

0 comments on commit 339ce1f

Please sign in to comment.