[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] branch master updated: fix waiting for merchant to be
From: |
gnunet |
Subject: |
[taler-deployment] branch master updated: fix waiting for merchant to be up |
Date: |
Fri, 28 May 2021 18:27:13 +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 97705ec fix waiting for merchant to be up
97705ec is described below
commit 97705eca5310cfef2dbe44df691f01dbe36ab0af
Author: MS <ms@taler.net>
AuthorDate: Fri May 28 18:27:08 2021 +0200
fix waiting for merchant to be up
---
bin/taler-deployment-config-instances | 53 ++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 25 deletions(-)
diff --git a/bin/taler-deployment-config-instances
b/bin/taler-deployment-config-instances
index 555daf8..7153287 100755
--- a/bin/taler-deployment-config-instances
+++ b/bin/taler-deployment-config-instances
@@ -24,11 +24,30 @@ def expect_env(name):
exit(1)
return val
-def wait_merchant():
- for proc in psutil.process_iter():
- if proc.name() == "taler-merchant-httpd" and proc.username ==
getuser():
- break
- sleep(1)
+def wait_merchant_up():
+ # Check it started correctly and it is ready to serve requests.
+ checks = 10
+ while checks > 0:
+
+ try:
+ resp = requests.get(urljoin(MERCHANT_BACKEND_BASE_URL, "/config"),
timeout=1.5)
+ except Exception:
+ sleep(1)
+ checks -= 1
+ continue
+
+ if resp.status_code != 200:
+ sleep(1)
+ checks -= 1
+ continue
+
+ # Ready.
+ break
+
+ if checks == 0:
+ print("Could not start the merchant (with TALER_MERCHANT_TOKEN in the
env).")
+ exit(1)
+
MERCHANT_BACKEND_BASE_URL = expect_env("TALER_ENV_MERCHANT_BACKEND")
TALER_ENV_NAME = expect_env("TALER_ENV_NAME")
@@ -111,25 +130,7 @@ def ensure_default_instance():
# Start the merchant natively.
merchant = Popen(["taler-merchant-httpd"], env=env_with_token)
- # Check it started correctly and it is ready to serve requests.
- checks = 10
- while checks > 0:
-
- try:
- resp = requests.get(urljoin(MERCHANT_BACKEND_BASE_URL, "/config"),
timeout=1.5)
- except Exception:
- sleep(1)
- checks -= 1
- continue
-
- if resp.status_code != 200:
- sleep(1)
- checks -= 1
- continue
-
- if checks == 0:
- print("Could not start the merchant (with TALER_MERCHANT_TOKEN in the
env).")
- exit(1)
+ wait_merchant_up()
ensure_instance(
"default",
@@ -145,7 +146,9 @@ def ensure_default_instance():
system("taler-deployment-arm -i taler-merchant")
ensure_default_instance()
-wait_merchant()
+# Needs to wait here since the merchant got lastly restarted via ARM,
+# in the previous operation.
+wait_merchant_up()
ensure_instance(
"blog",
--
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: fix waiting for merchant to be up,
gnunet <=