Make all the checks run async
This commit is contained in:
parent
9200d0db9b
commit
15d3a23351
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue