We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a51aef1 commit a33a2aeCopy full SHA for a33a2ae
1 file changed
cleanup_watcher.py
@@ -9,8 +9,6 @@
9
PARENT = os.getenv("PARENT")
10
SERVICE_NAME = os.getenv("K_SERVICE")
11
12
-HEARTBEAT_URL = "http://127.0.0.1:5000/health"
13
-
14
15
def delete_service():
16
print("Deleting service")
@@ -24,13 +22,12 @@ def delete_service():
24
22
25
23
26
while True:
27
- time.sleep(60)
28
- delete_service()
29
- break
30
- # try:
31
- # r = requests.get(HEARTBEAT_URL, timeout=5)
32
- # if r.status_code != 200:
33
- # raise Exception("Bad status")
34
- # except Exception:
35
- # delete_service()
36
- # break
+ time.sleep(30)
+ try:
+ response = requests.get("http://127.0.0.1/geode/health", timeout=5)
+ print("response", response)
+ if response.status_code != 200:
+ raise Exception("Bad status")
+ except Exception:
+ delete_service()
+ break
0 commit comments