Skip to content

Commit

Permalink
Create a new context for the http server
Browse files Browse the repository at this point in the history
  • Loading branch information
rnaveiras committed Jan 18, 2025
1 parent fc671ba commit e4d9e60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"net"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"

// _ "net/http/pprof"
Expand Down Expand Up @@ -95,7 +93,7 @@ func main() {
server := &http.Server{
Addr: *listenAddress,
ReadHeaderTimeout: readHeaderTimeout,
BaseContext: func(_ net.Listener) context.Context { return ctx },
BaseContext: func(_ net.Listener) context.Context { return context.Background() },
}
err = server.ListenAndServe()
if err != nil {
Expand Down

0 comments on commit e4d9e60

Please sign in to comment.