Skip to content

Perf/batch endpoints parallel analyzers#34

Merged
Stanzin7 merged 3 commits intomasterfrom
perf/batch-endpoints-parallel-analyzers
Mar 18, 2026
Merged

Perf/batch endpoints parallel analyzers#34
Stanzin7 merged 3 commits intomasterfrom
perf/batch-endpoints-parallel-analyzers

Conversation

@Stanzin7
Copy link
Owner

No description provided.

Stanfordy and others added 3 commits March 17, 2026 20:57
…miter

Both batch endpoints were missing the `http_request: Request` parameter
required by slowapi to extract the client IP for rate limiting, causing
a startup crash on deploy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 18, 2026 02:10
@Stanzin7 Stanzin7 merged commit b5ed141 into master Mar 18, 2026
11 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the FastAPI service to make the /health endpoint “fail-open” (always HTTP 200) for deployment healthchecks, and adjusts batch scan endpoints to accept a Request object (likely to support rate limiting).

Changes:

  • Add a /health special-case in the global exception handler to return HTTP 200 with a degraded payload.
  • Wrap /health handler logic in try/except and hide it from the OpenAPI schema (include_in_schema=False).
  • Update /api/scan/batch-results and /api/scan/batch-status signatures to accept request: Request.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"""
# Never return 503 for /health so Railway healthchecks don't fail the deploy
if request.url.path == "/health":
logger.error("Error during /health: %s", exc)
Comment on lines +196 to +197
"detail": SERVICE_UNAVAILABLE_MESSAGE,
"error_code": "SERVICE_HEALTH_DEGRADED",
Comment on lines +3475 to +3476
except Exception as exc:
logger.error("Health check internal error: %s", exc)
Comment on lines +3466 to +3482
try:
uptime_seconds = int((datetime.now(timezone.utc) - _health_start_time).total_seconds())
flags = get_feature_flags()
return {
"status": "healthy",
"version": "1.0.0",
"uptime_seconds": uptime_seconds,
"mode": flags.mode,
}
except Exception as exc:
logger.error("Health check internal error: %s", exc)
return {
"status": "degraded",
"version": "1.0.0",
"uptime_seconds": 0,
"mode": "unknown",
}
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.

3 participants