Skip to content

Commit

Permalink
update response body
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Apr 2, 2024
1 parent ee4f958 commit 08a613d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions novel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ def do_GET(self):
elif self.path == "/health":
if time.time() - last_updated_time > loop_time:
self.send_response(500)
self.wfile.write(b"Delayed")
response = json.dumps({"status": "delayed"})
else:
self.send_response(200)
self.wfile.write(b"OK")
response = json.dumps({"status": "ok"})
self.send_header("Content-type", "application/json")
self.end_headers()
self.wfile.write(response.encode("utf-8"))
else:
self.send_response(404)
self.send_header("Content-type", "text/plain")
Expand Down

0 comments on commit 08a613d

Please sign in to comment.