الملفات
ghaymah-exam-ayashosha-sre/q1-deploy-monitor/health-check.py
2026-07-29 14:42:46 +03:00

14 أسطر
347 B
Python

from urllib.request import urlopen
from urllib.error import HTTPError
import time
while True:
try:
with urlopen('https://node-app-75fbd9c11652.hosted.ghaymah.systems/health') as response:
print(f"Status Code: {response.status}")
except HTTPError as error:
print(f"Error Status Code: {error.code}")
time.sleep(30)