Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change time estimate print-out #63

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading