Reduce allowance spending threshold.

This commit is contained in:
Marcin Jachymiak 2020-04-14 14:50:01 -04:00
parent c0e148908e
commit 02250ce385
1 changed files with 5 additions and 4 deletions

View File

@ -56,12 +56,13 @@ async def check_health():
# Send an alert if there is less than 1 allowance worth of money left. # Send an alert if there is less than 1 allowance worth of money left.
if balance < allowance_funds: if balance < allowance_funds:
await send_msg(client, "Wallet balance running low. \n{}`".format(balance_msg), force_notify=True) await send_msg(client, "Wallet balance running low. \n{}".format(balance_msg), force_notify=True)
return return
# Alert devs when 1/2 the allowance is gone # Alert devs when only a fraction of the allowance is remaining.
if allocated_funds >= unallocated_funds: UNALLOC_THRESHOLD = 0.2
await send_msg(client, "Allowance half spent: \n{}".format(alloc_msg), force_notify=True) if allocated_funds >= UNALLOC_THRESHOLD * allowance_funds :
await send_msg(client, "{} of allowance spent: \n{}".format(UNALLOC_THRESHOLD, alloc_msg), force_notify=True)
return return
# Send an informational heartbeat if all checks passed. # Send an informational heartbeat if all checks passed.