на оценку 3

This commit is contained in:
2026-10-21 13:51:35 +03:00
parent 3f69970b05
commit bd28f1ae26
24 changed files with 1130 additions and 91 deletions
+12 -2
View File
@@ -85,7 +85,12 @@ func main() {
log.Fatalf("[FATAL] Invalid cursor configuration: %v", err)
}
service, err := application.NewService(applicationStore, cursorCodec, cfg.SessionTTL)
service, err := application.NewService(
applicationStore,
cursorCodec,
cfg.SessionTTL,
application.WithIdempotencyTTL(cfg.IdempotencyTTL),
)
if err != nil {
log.Fatalf("[FATAL] Application initialization failed: %v", err)
}
@@ -149,6 +154,7 @@ func main() {
rootHandler = middleware.Recovery(rootHandler)
rootHandler = middleware.Logger(rootHandler)
rootHandler = middleware.RequestID(rootHandler)
rootHandler = middleware.InstanceID(cfg.InstanceID, rootHandler)
server := &http.Server{
Addr: cfg.HTTPAddress(),
@@ -161,7 +167,11 @@ func main() {
serverErrors := make(chan error, 1)
go func() {
log.Printf("[INFO] Server starting on %s", server.Addr)
log.Printf(
"[INFO] Server instance %s starting on %s",
cfg.InstanceID,
server.Addr,
)
serverErrors <- server.ListenAndServe()
}()