cleanup
This commit is contained in:
parent
b383cde1fe
commit
2a01477a5e
10
main.py
10
main.py
|
|
@ -67,8 +67,6 @@ def seconds_to_time(total_seconds: float) -> str:
|
||||||
def main():
|
def main():
|
||||||
executor = ThreadPoolExecutor(max_workers=len(earners))
|
executor = ThreadPoolExecutor(max_workers=len(earners))
|
||||||
while True:
|
while True:
|
||||||
threads = []
|
|
||||||
|
|
||||||
#Run earners
|
#Run earners
|
||||||
futures = [executor.submit(e.run) for e in earners]
|
futures = [executor.submit(e.run) for e in earners]
|
||||||
for future in as_completed(futures):
|
for future in as_completed(futures):
|
||||||
|
|
@ -76,12 +74,6 @@ def main():
|
||||||
future.result()
|
future.result()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error in thread - {e}")
|
print(f"Error in thread - {e}")
|
||||||
# for item in earners:
|
|
||||||
# threads.append(Thread(target=item.run))
|
|
||||||
# for item in threads:
|
|
||||||
# item.start()
|
|
||||||
# for item in threads:
|
|
||||||
# item.join()
|
|
||||||
|
|
||||||
#Print status
|
#Print status
|
||||||
subscriptions = []
|
subscriptions = []
|
||||||
|
|
@ -106,7 +98,6 @@ def main():
|
||||||
last_redemption_value = ""
|
last_redemption_value = ""
|
||||||
else:
|
else:
|
||||||
last_redemption_value = datetime.datetime.fromtimestamp(last_redemption_value).strftime('@%Y/%m/%d %H:%M:%S')
|
last_redemption_value = datetime.datetime.fromtimestamp(last_redemption_value).strftime('@%Y/%m/%d %H:%M:%S')
|
||||||
|
|
||||||
print("-"*90)
|
print("-"*90)
|
||||||
total_on_trading = sum([item.get_trading_balance() for item in earners])
|
total_on_trading = sum([item.get_trading_balance() for item in earners])
|
||||||
total_on_earning = sum([item.get_earning_balance() for item in earners])
|
total_on_earning = sum([item.get_earning_balance() for item in earners])
|
||||||
|
|
@ -116,6 +107,7 @@ def main():
|
||||||
print(f"Version {version} | Total funds: {total_funds:.2f} USDT | On earn: {total_on_earning:.2f} USDT ({total_on_earning/total_funds*100:.2f}%)")
|
print(f"Version {version} | Total funds: {total_funds:.2f} USDT | On earn: {total_on_earning:.2f} USDT ({total_on_earning/total_funds*100:.2f}%)")
|
||||||
print(f"{time_of_day} | Uptime: {seconds_to_time(time.time()-start_time)}")
|
print(f"{time_of_day} | Uptime: {seconds_to_time(time.time()-start_time)}")
|
||||||
print(colors.blue+"="*90+colors.white)
|
print(colors.blue+"="*90+colors.white)
|
||||||
|
|
||||||
#Wait for next lap
|
#Wait for next lap
|
||||||
time.sleep(config["lap_time"])
|
time.sleep(config["lap_time"])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue