Skip to content

Commit

Permalink
adding timeout to Allocation API service (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkanatsios committed Dec 13, 2021
1 parent 0764a0d commit b6f58fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions operator/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"net/http"
"os"
"time"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -98,8 +99,11 @@ func (s *ApiServer) Start(ctx context.Context) error {
log.Info("serving allocation API service", "addr", addr, "port", listeningPort)

srv := &http.Server{
Addr: addr,
Handler: mux,
Addr: addr,
Handler: mux,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
MaxHeaderBytes: http.DefaultMaxHeaderBytes,
}

done := make(chan struct{})
Expand Down

0 comments on commit b6f58fb

Please sign in to comment.