feat: implement database creation status check with retries#10
feat: implement database creation status check with retries#10konradmichalik merged 4 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds a post-creation readiness check to MittwaldApi that polls the Mittwald API for MySQL user status after database creation; updates docblocks to declare possible Guzzle/response/exception throws. Also adjusts whitespace/formatting in Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MittwaldApi
participant MittwaldAPI_Service
participant MySQL_User
Caller->>MittwaldApi: request create(databaseConfig)
MittwaldApi->>MittwaldAPI_Service: POST /databases (create)
MittwaldAPI_Service-->>MittwaldApi: 201 Created + response
MittwaldApi->>MittwaldAPI_Service: GET /databases/{id}/users (poll status) (repeat)
MittwaldAPI_Service-->>MittwaldApi: user.status = initializing|ready
alt status == ready
MittwaldApi-->>Caller: return success
else retries exhausted or error
MittwaldApi-->>Caller: throw RuntimeException / propagate exceptions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/Database/Manager/MittwaldApi.php`:
- Around line 216-242: In checkForDatabaseReadyStatus, the loop always calls
sleep($waitingTime) even after the final retry, which adds an unnecessary delay;
fix it by only sleeping when another attempt will follow (e.g., decrement
$maxRetries or check $maxRetries > 1 before calling sleep), ensuring the call to
sleep($waitingTime) happens only if there are remaining retries, and keep the
existing try/catch and return true behavior in the same method.
Summary by CodeRabbit
Bug Fixes
Documentation