[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] branch master updated: reuse loop checker
From: |
gnunet |
Subject: |
[taler-deployment] branch master updated: reuse loop checker |
Date: |
Thu, 25 Aug 2022 16:11:36 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository deployment.
The following commit(s) were added to refs/heads/master by this push:
new 30863ef reuse loop checker
30863ef is described below
commit 30863eff4bb2f83fff89f962d045266e220d9124
Author: MS <ms@taler.net>
AuthorDate: Thu Aug 25 16:11:32 2022 +0200
reuse loop checker
---
bin/taler-gv | 32 +++++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/bin/taler-gv b/bin/taler-gv
index a63bfca..9e6693c 100755
--- a/bin/taler-gv
+++ b/bin/taler-gv
@@ -529,6 +529,27 @@ CURRENCY = "KUDOS"
def prepare(postgres_db_name):
"""Generate configuration, run-time blobs, instances, euFin accounts."""
+ def is_serving(check_url, tries=10):
+ for i in range(tries):
+ try:
+ print_nn(".")
+ # Raises if the service is not reachable.
+ response = requests.get(
+ check_url,
+ timeout=1
+ )
+ # The reverse proxy may return 500 if the
+ # end service is not ready, therefore this
+ # case should be tolerated.
+ response.raise_for_status()
+ except:
+ time.sleep(0.5)
+ if i == tries - 1:
+ return False
+ continue
+ break
+ return True
+
def fail(reason=None):
if reason:
print("ERROR:", reason)
@@ -1315,15 +1336,8 @@ def prepare(postgres_db_name):
print(" OK")
print_nn("Launching the exchange...")
subprocess.run(["systemctl", "--user", "start",
"taler-local-exchange-httpd.service"])
- res = requests.get("https://exchange.demo.taler.net/")
- res_count = 0
- while res.status_code != 200:
- if res_count == 10:
- print("Exchange unreachable")
- sys.exit(1)
- res_count = res_count + 1
- time.sleep(1)
- res = requests.get("https://exchange.demo.taler.net/")
+ if not is_serving("https://exchange.demo.taler.net/"):
+ fail(f"Exchange did not start correctly.")
print(" OK")
print_nn("exchange-offline: signing key material...")
Command([
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-deployment] branch master updated: reuse loop checker,
gnunet <=