Skip to content

Commit

Permalink
repeats name variable initialisation if failed. issue 64
Browse files Browse the repository at this point in the history
resolve apel#64
  • Loading branch information
DanielPerkins7 committed Aug 3, 2023
1 parent 919a0f2 commit 0ea9f5f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ssm/ssm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,17 @@ def _save_msg_to_queue(self, body, empaid):
log.error('Failed to read or write file: %s', error)
for i in range(3):
try:
name = self._rejectq.add({'body': body,
if extracted_msg is None or err_msg is not None:
name = self._rejectq.add({'body': body,
'signer': signer,
'empaid': empaid,
'error': err_msg})
log.info("Message saved to reject queue as %s", name)
name = self._inq.add({'body': extracted_msg,
log.info("Message saved to reject queue as %s", name)
else: # message verified ok
name = self._inq.add({'body': extracted_msg,
'signer': signer,
'empaid': empaid})
log.info("Message saved to incoming queue as %s", name)
log.info("Message saved to incoming queue as %s", name)
except:
continue
break
Expand Down

0 comments on commit 0ea9f5f

Please sign in to comment.