forked from mtusi2026/mtusi2026lab3
на оценку 3
This commit is contained in:
+12
-2
@@ -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()
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user