milergeo added
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user