From 02250ce3851ceb81c260fe0b29c20f7255e55645 Mon Sep 17 00:00:00 2001 From: Marcin Jachymiak Date: Tue, 14 Apr 2020 14:50:01 -0400 Subject: [PATCH] Reduce allowance spending threshold. --- setup-scripts/funds-checker.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup-scripts/funds-checker.py b/setup-scripts/funds-checker.py index d0750a8c..c40089e4 100755 --- a/setup-scripts/funds-checker.py +++ b/setup-scripts/funds-checker.py @@ -56,12 +56,13 @@ async def check_health(): # Send an alert if there is less than 1 allowance worth of money left. 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 - # Alert devs when 1/2 the allowance is gone - if allocated_funds >= unallocated_funds: - await send_msg(client, "Allowance half spent: \n{}".format(alloc_msg), force_notify=True) + # Alert devs when only a fraction of the allowance is remaining. + UNALLOC_THRESHOLD = 0.2 + if allocated_funds >= UNALLOC_THRESHOLD * allowance_funds : + await send_msg(client, "{} of allowance spent: \n{}".format(UNALLOC_THRESHOLD, alloc_msg), force_notify=True) return # Send an informational heartbeat if all checks passed.