Keep Render backend wakeup alive long enough for Xaman login - #8
Merged
Conversation
Allow the readiness probe to stay connected long enough for a sleeping Render backend to start.
Introduce separate timeout constants for health checks and default requests.
There was a problem hiding this comment.
Pull request overview
Adjusts frontend warm-up and proxy timeouts so the Render free-tier backend can fully wake before Xaman login and food search proceed, and updates UI messaging to set accurate expectations during cold starts.
Changes:
- Extend overall backend warm-up window to 90s and per-attempt warm-up timeout to 70s.
- Increase the
/healthproxy upstream timeout to 70s while keeping other proxied routes at 18s. - Update Xaman login and food search status text to reflect the longer cold-start window.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/lib/backendRequest.ts | Extends warm-up timing constants used by waitForBackendReady. |
| frontend/components/XamanLoginPanel.tsx | Updates login status text to reflect 90s cold-start wait. |
| frontend/components/FoodSearchPlaceholder.tsx | Updates search status text to reflect 90s cold-start wait. |
| frontend/app/api/backend/[...path]/route.ts | Applies longer upstream timeout for the health readiness probe while keeping default timeout for other routes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
91
to
+95
| const controller = new AbortController(); | ||
| const timeoutId = setTimeout(() => controller.abort(), UPSTREAM_TIMEOUT_MS); | ||
| // A sleeping Render backend can need well over the ordinary request timeout | ||
| // before its health endpoint answers. Keep only this readiness probe alive | ||
| // long enough to wake it; normal application requests retain the tighter | ||
| // timeout after readiness has been established. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Production diagnosis
The uploaded phone recording showed repeated 65-second login waits with no successful redirect. A direct production probe measured roughly 33 seconds for the backend to wake, while the frontend proxy cut each health request off after 18 seconds.
Verification