Skip to content

fix: make healthcheck ping quota-free api docs page - #201

Open
vlnst wants to merge 2 commits into
httpjamesm:mainfrom
vlnst:fix-healthcheck-ping
Open

vlnst wants to merge 2 commits into
httpjamesm:mainfrom
vlnst:fix-healthcheck-ping

Conversation

@vlnst

@vlnst vlnst commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

/healthz always returns 503: https://stackoverflow.com redirects to a Cloudflare challenge (403), even when the app works fine with SCRAPER=api.

With SCRAPER=api, the healthcheck now pings https://api.stackexchange.com/docs instead, since that's what the app depends on. /docs doesn't use API quota, unlike /2.3/* methods. A check every 60s would use up the 300/day anonymous quota on its own. The HTML scraper keeps pinging stackoverflow.com, since it depends on that. The unused stackexchange.com check is removed.

The Docker healthcheck binary ignored the status code, so the container showed as healthy even when /healthz returned 503. It now exits 1 on anything but 200.

Tested: /healthz returns 200 with SCRAPER=api; the healthcheck binary exits 0 there, and 1 when /healthz returns 503 or the app is down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant