Skip to content

Commit 4b3dce3

Browse files
procedure repeated
resolve apel#64 . repeats the procedure either until it works or until it has been repeated three times
1 parent eb31217 commit 4b3dce3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ssm/ssm2.py

+8
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@ def _handle_msg(self, text):
316316

317317
return message, signer, None
318318

319+
fails = 0
319320
def _save_msg_to_queue(self, body, empaid):
320321
"""Extract message contents and add to the accept or reject queue."""
321322
extracted_msg, signer, err_msg = self._handle_msg(body)
323+
<<<<<<< HEAD
324+
=======
325+
326+
>>>>>>> 4067424... procedure repeated
322327
try:
323328
# If the message is empty or the error message is not empty
324329
# then reject the message.
@@ -347,6 +352,9 @@ def _save_msg_to_queue(self, body, empaid):
347352

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

351359
def _send_msg(self, message, msgid):
352360
"""Send one message using stomppy.

0 commit comments

Comments
 (0)