diff --git a/pkg/controllers/health_check.go b/pkg/controllers/health_check.go index 0f5ab82..2001156 100644 --- a/pkg/controllers/health_check.go +++ b/pkg/controllers/health_check.go @@ -9,20 +9,20 @@ import ( func HandleHealthCheck(c *fiber.Ctx) error { db, err := config.GetConfig().DB.DB() if err != nil { - return c.Status(fiber.StatusInternalServerError).SendString("DB connection error") + return c.Status(fiber.StatusServiceUnavailable).SendString("DB connection error") } err = db.Ping() if err != nil { - return c.Status(fiber.StatusInternalServerError).SendString("DB connection error") + return c.Status(fiber.StatusServiceUnavailable).SendString("DB connection error") } _, err = config.GetConfig().RDS.Ping(context.Background()).Result() if err != nil { - return c.Status(fiber.StatusInternalServerError).SendString("Redis connection error") + return c.Status(fiber.StatusServiceUnavailable).SendString("Redis connection error") } if !config.GetConfig().NatsConn.IsConnected() { - return c.Status(fiber.StatusInternalServerError).SendString("Nats connection error") + return c.Status(fiber.StatusServiceUnavailable).SendString("Nats connection error") } return c.Status(fiber.StatusOK).SendString("Healthy")