mirror of
https://github.com/basicswap/basicswap.git
synced 2025-03-25 00:28:53 +00:00
Ignore undecryptable messages when expiring.
This commit is contained in:
parent
5f0e708812
commit
3ed6781c9f
1 changed files with 11 additions and 6 deletions
|
@ -3560,12 +3560,17 @@ class BasicSwap(BaseApp):
|
||||||
num_messages = 0
|
num_messages = 0
|
||||||
num_removed = 0
|
num_removed = 0
|
||||||
for msg in ro['messages']:
|
for msg in ro['messages']:
|
||||||
num_messages += 1
|
try:
|
||||||
expire_at = msg['sent'] + msg['ttl']
|
num_messages += 1
|
||||||
if expire_at < now:
|
expire_at = msg['sent'] + msg['ttl']
|
||||||
options = {'encoding': 'none', 'delete': True}
|
if expire_at < now:
|
||||||
del_msg = ci_part.json_request(rpc_conn, 'smsg', [msg['msgid'], options])
|
options = {'encoding': 'none', 'delete': True}
|
||||||
num_removed += 1
|
del_msg = ci_part.json_request(rpc_conn, 'smsg', [msg['msgid'], options])
|
||||||
|
num_removed += 1
|
||||||
|
except Exception as e:
|
||||||
|
if self.debug:
|
||||||
|
self.log.error(traceback.format_exc())
|
||||||
|
continue
|
||||||
|
|
||||||
if num_messages + num_removed > 0:
|
if num_messages + num_removed > 0:
|
||||||
self.log.info('Expired {} / {} messages.'.format(num_removed, num_messages))
|
self.log.info('Expired {} / {} messages.'.format(num_removed, num_messages))
|
||||||
|
|
Loading…
Reference in a new issue