feat: implement estim 4

This commit is contained in:
2026-11-06 05:12:28 +03:00
parent ec111aadfb
commit b48e71f433
29 changed files with 504 additions and 194 deletions
+6
View File
@@ -4,6 +4,7 @@ import (
"context"
"log/slog"
"net/http"
"sync/atomic"
"messenger/internal/service"
)
@@ -17,6 +18,7 @@ type Handler struct {
messages *service.MessageService
deps []Pinger
log *slog.Logger
draining atomic.Bool
}
func New(users *service.UserService, auth *service.AuthService, chats *service.ChatService,
@@ -24,6 +26,10 @@ func New(users *service.UserService, auth *service.AuthService, chats *service.C
return &Handler{users: users, auth: auth, chats: chats, messages: messages, deps: deps, log: log}
}
func (h *Handler) StartDraining() {
h.draining.Store(true)
}
func (h *Handler) NotFound(w http.ResponseWriter, _ *http.Request) {
writeError(w, http.StatusNotFound, "not_found", "resource not found")
}