forked from mtusi2026/mtusi2026lab3
feat(app) lab 3 implemented
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// Package health exposes liveness and readiness endpoints plus the process
|
||||
// shutdown flag used by readiness.
|
||||
package health
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab2/internal/common"
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab2/internal/session"
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab2/internal/store"
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab/internal/common"
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab/internal/session"
|
||||
"gitflic.ru/project/bulla-max/mtusi2026lab/internal/store"
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
@@ -32,9 +34,6 @@ func (h *Handler) Live(c fiber.Ctx) error {
|
||||
return c.JSON(Status{Status: "ok"})
|
||||
}
|
||||
|
||||
// Ready answers whether the synchronous mandatory path can be served. Both
|
||||
// PostgreSQL and Redis are critical here: business data and sessions live in
|
||||
// them respectively.
|
||||
func (h *Handler) Ready(c fiber.Ctx) error {
|
||||
if shuttingDown.Load() {
|
||||
return common.SendError(c, fiber.StatusServiceUnavailable,
|
||||
|
||||
Reference in New Issue
Block a user