milergeo added

This commit is contained in:
2026-10-06 12:26:57 +05:30
parent 220e934045
commit 9b94be1f07
10 changed files with 329 additions and 44 deletions

View File

@@ -7,6 +7,7 @@ import (
"doormile/config"
"doormile/controllers"
"doormile/db"
"doormile/internal/milergeo"
"doormile/internal/sms"
"doormile/internal/ws"
"doormile/middlewares"
@@ -69,11 +70,21 @@ func RegisterRoutes(app *fiber.App, cfg *config.Config) {
status = fiber.StatusServiceUnavailable
}
// Whether rider search works on this Redis. Reported, not gating:
// a broken search stops auto-assignment, not the API.
redisGeo := "error: redis not available"
if db.Rdb != nil {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
redisGeo = milergeo.Probe(ctx, db.Rdb)
}
return c.Status(status).JSON(fiber.Map{
"status": "ready",
"checks": fiber.Map{
"postgres": dbStatus,
"redis": redisStatus,
"postgres": dbStatus,
"redis": redisStatus,
"redis_geo": redisGeo,
// Reported, but deliberately NOT gating readiness: the miler and
// console surfaces work perfectly without SMS. It is here because
// 'the OTP never arrived' was answerable only by reading code, and