Skip to content

Commit a33a2ae

Browse files
committed
test
1 parent a51aef1 commit a33a2ae

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

cleanup_watcher.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
PARENT = os.getenv("PARENT")
1010
SERVICE_NAME = os.getenv("K_SERVICE")
1111

12-
HEARTBEAT_URL = "http://127.0.0.1:5000/health"
13-
1412

1513
def delete_service():
1614
print("Deleting service")
@@ -24,13 +22,12 @@ def delete_service():
2422

2523

2624
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
25+
time.sleep(30)
26+
try:
27+
response = requests.get("http://127.0.0.1/geode/health", timeout=5)
28+
print("response", response)
29+
if response.status_code != 200:
30+
raise Exception("Bad status")
31+
except Exception:
32+
delete_service()
33+
break

0 commit comments

Comments
 (0)