For monitoring the monitor, add a simple HTTP health endpoint:
def start_health_server(self):
"""Simple HTTP server for health checks."""
from http.server import HTTPServer, BaseHTTPRequestHandler
class HealthHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/health':
self.send_response(200)
self.end_headers()
self.wfile.write(b'OK')
server = HTTPServer(('localhost', 9102), HealthHandler)
import threading
threading.Thread(target=server.serve_forever, daemon=True).start()
For monitoring the monitor, add a simple HTTP health endpoint:
def start_health_server(self):
"""Simple HTTP server for health checks."""
from http.server import HTTPServer, BaseHTTPRequestHandler
class HealthHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/health':
self.send_response(200)
self.end_headers()
self.wfile.write(b'OK')
server = HTTPServer(('localhost', 9102), HealthHandler)
import threading
threading.Thread(target=server.serve_forever, daemon=True).start()
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
For monitoring the monitor, add a simple HTTP health endpoint:
def start_health_server(self):
"""Simple HTTP server for health checks."""
from http.server import HTTPServer, BaseHTTPRequestHandler