Skip to content

Commit

Permalink
procedure repeated
Browse files Browse the repository at this point in the history
resolve apel#64  .  repeats the procedure either until it works or until it has been repeated three times
  • Loading branch information
DanielPerkins7 committed Aug 2, 2023
1 parent eb31217 commit 4b3dce3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ssm/ssm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@ def _handle_msg(self, text):

return message, signer, None

fails = 0
def _save_msg_to_queue(self, body, empaid):
"""Extract message contents and add to the accept or reject queue."""
extracted_msg, signer, err_msg = self._handle_msg(body)
<<<<<<< HEAD
=======

>>>>>>> 4067424... procedure repeated
try:
# If the message is empty or the error message is not empty
# then reject the message.
Expand Down Expand Up @@ -347,6 +352,9 @@ def _save_msg_to_queue(self, body, empaid):

except (IOError, OSError) as error:
log.error('Failed to read or write file: %s', error)
fails += 1
if fails <= 3:
return _save_msg_to_queue(self, body, empaid)

def _send_msg(self, message, msgid):
"""Send one message using stomppy.
Expand Down

0 comments on commit 4b3dce3

Please sign in to comment.