feat(service): implement graceful shutdown for HTTP server
Add a context with timeout to handle graceful shutdown of the HTTP server. Update error handling during the server's close to include context-aware shutdown. Ensure that the server properly logs only non-closed errors when listening.
This commit is contained in:
+2
-2
@@ -3,8 +3,8 @@ package graph
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/apex/log"
|
||||
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
||||
|
||||
"gitlab.com/unboundsoftware/schemas/cache"
|
||||
@@ -26,7 +26,7 @@ type Publisher interface {
|
||||
type Resolver struct {
|
||||
EventStore eventsourced.EventStore
|
||||
Publisher Publisher
|
||||
Logger log.Interface
|
||||
Logger *slog.Logger
|
||||
Cache *cache.Cache
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user