Skip to content

Commit

Permalink
Some TG reporting for new_deal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
M1ch43lV committed Aug 20, 2022
1 parent 6758ed3 commit 0374558
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
15 changes: 8 additions & 7 deletions multibot.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ def disable(self):
)

def new_deal(self, triggerpair):
more_inform = self.attributes.get("extensive_notifications", False)
# Triggers a new deal
if triggerpair:
pair = triggerpair
Expand Down Expand Up @@ -592,14 +593,14 @@ def new_deal(self, triggerpair):
"Max active deals of "
+ str(self.asyncState.multibot["max_active_deals"])
+ " reached, not adding a new one.",
True,
more_inform,
)
else:
# modified output because this will be the most common error
self.logging.error(
"No deal triggered: "
+ "function new_deal: "
+ error["msg"].split(":")[1].split(" ")[1]
# modified output because of open deal - this will be the most common error
self.logging.info(
"No deal triggered because of "
+ error["msg"].split(":")[1].split(" ")[1],
more_inform,
)
return False
else:
Expand Down Expand Up @@ -896,7 +897,7 @@ def trigger(self, random_only=False):

self.asyncState.multibot["pairs"].append(pair)

# if limit_symrank_pairs_to_mad == True, add trigger coin to pairs_volume list and sort
# if limit_symrank_pairs_to_mad == True, add trigger pair to pairs_volume list and sort
if (
self.attributes.get("limit_symrank_pairs_to_mad", False)
and self.asyncState.pairs_volume
Expand Down
9 changes: 8 additions & 1 deletion singlebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,14 @@ def report_deals(self):
payload={"limit": 100, "bot_id": bot["id"]},
)
if error:
self.logging.error("function report_deals: " + error["msg"])
self.logging.error(
"function report_deals: botid: "
+ str(bot["id"])
+ " bot: "
+ str(bot)
+ " error msg: "
+ error["msg"]
)
else:
for deals in data:
if (
Expand Down

0 comments on commit 0374558

Please sign in to comment.