Skip to content

Commit

Permalink
chore: change time estimate print-out
Browse files Browse the repository at this point in the history
  • Loading branch information
aeweda committed Feb 19, 2024
1 parent 2046a69 commit 9b27e27
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions price_feeds_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,15 @@ def handle_loop(
if time_left_secs <= 86400 * 3 and timer_out:
# start warning every 900 seconds if estimated time before draiing funds is less than 3 days
low_balance_ts = loop_ts
print(f"LOW FUNDS !!!: estimated {round(time_left_secs / 3600, 2)} hours before running out of funds")
else:
print(f"Time-To-Die: {round(time_left_secs / 3600, 2)} hours")
time_left_hours = time_left_secs / 3600
if time_left_hours < 1:
print("LOW FUNDS !!!: estimated less than 1 hour before running out of funds")
elif time_left_hours < 10:
estimate = math.floor(time_left_hours)
print(f"LOW FUNDS !!!: estimated less than {estimate} hours before running out of funds")
else:
estimate = math.ceil(time_left_hours / 10) * 10
print(f"LOW FUNDS !!!: estimated less than {estimate} hours before running out of funds")

latest_prices = feeds.functions.latestPrices(ids).call()
except Exception as ex:
Expand Down

0 comments on commit 9b27e27

Please sign in to comment.