Post IRC message on cleanup
This commit is contained in:
parent
74e108603f
commit
c8e9368247
|
@ -125,9 +125,13 @@ def cleanup(subclass, references):
|
|||
:param references: list of references to reconcile against
|
||||
:type references: list
|
||||
"""
|
||||
messages = []
|
||||
for tx, reference in get_ref_map().items():
|
||||
if reference not in references:
|
||||
if get_subclass(reference) == subclass:
|
||||
log.info(f"Archiving trade reference: {reference} / TX: {tx}")
|
||||
logmessage = f"Archiving trade reference: {reference} / TX: {tx}"
|
||||
messages.append(logmessage)
|
||||
log.info(logmessage)
|
||||
r.rename(f"trade.{tx}.reference", f"archive.trade.{tx}.reference")
|
||||
r.rename(f"trade.{reference}", f"archive.trade.{reference}")
|
||||
return messages
|
||||
|
|
|
@ -171,7 +171,9 @@ class Local(util.Base):
|
|||
self.last_dash.remove(ref)
|
||||
if reference and reference not in current_trades:
|
||||
current_trades.append(reference)
|
||||
db.cleanup(self.platform, current_trades)
|
||||
messages = db.cleanup(self.platform, current_trades)
|
||||
for message in messages:
|
||||
self.ux.irc.sendmsg(f"{self.platform}: {message}")
|
||||
|
||||
def got_recent_messages(self, messages, send_irc=True):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue