commit 9ec41ad1a7609cca6e5d53775b90306890c94ed8
parent 8c42ad742cdd6f72e67545a2d34e42a3ae67214f
Author: ms <ms@taler.net>
Date: Fri, 2 Jul 2021 15:14:08 +0200
Tip reserves check.
Christian suggests to only look at the largest tip reserve.
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/buildbot/check_tip_reserve.py b/buildbot/check_tip_reserve.py
@@ -31,7 +31,6 @@ resp = requests.get(
headers = {"Authorization": f"Bearer {TALER_ENV_FRONTENDS_APITOKEN}"}
)
-# Instance exists, we PATCH the auth just in case it changed.
if resp.status_code != 200:
print("merchant backend failed at providing a list of tip reserves!")
exit(1)
@@ -41,18 +40,15 @@ if len(reserves) == 0:
print("merchant backend has NO tip reserves active!")
exit(1)
-total_amount = Amount.parse(reserves[0].get("committed_amount"))
+max_amount = Amount.parse(reserves[0].get("committed_amount"))
for item in reserves[1:]:
item_amount = Amount.parse(item.get("committed_amount"))
- total_amount += item_amount
-
-if total_amount.is_zero():
- print("tip money reached zero")
- exit(1)
+ if item_amount > max_amount:
+ max_amount = item_amount
# FIXME, eventually, just check the largest amount left through
# all the reserves.
-print(f"Tip money is available: {total_amount}")
+print(f"Largest tip reserve: {max_amount}")
print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
print(f"=========================================")
print(f"FULL DUMP FROM THE BACKEND:\n{resp.text}")