Make all the checks run async

This commit is contained in:
Mark Veidemanis 2022-06-14 17:43:26 +01:00
parent 9200d0db9b
commit 15d3a23351
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 11 additions and 7 deletions

View File

@ -60,17 +60,21 @@ class Money(util.Base):
# a_certs=ca_certs_path,
)
@inlineCallbacks
def run_checks_in_thread(self):
"""
Run all the balance checks that output into ES in another thread.
"""
self.get_total()
self.get_remaining()
self.get_profit()
self.get_profit(True)
self.get_open_trades_usd()
self.get_total_remaining()
self.get_total_with_trades()
total = self.get_total()
remaining = self.get_remaining()
profit = self.get_profit()
profit_with_trades = self.get_profit(True)
open_trades = self.get_open_trades_usd()
total_remaining = self.get_total_remaining()
total_with_trades = self.get_total_with_trades()
# This will make them all run concurrently, hopefully not hitting rate limits
for x in (total, remaining, profit, profit_with_trades, open_trades, total_remaining, total_with_trades):
yield x
def setup_loops(self):
"""