Skip to content

Commit

Permalink
Adding HTTP compression
Browse files Browse the repository at this point in the history
Signed-off-by: Louis-Etienne Dorval <louis-etienne.dorval@ticketmaster.com>
  • Loading branch information
Louis-Etienne Dorval committed Nov 17, 2017
1 parent 5db9cde commit ce9f725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"strconv"
"syscall"

"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -111,11 +112,12 @@ func main() {
apiHandler.RegisterRoutes(r)
registerStaticHandler(r, logger, queryOpts)
portStr := ":" + strconv.Itoa(queryOpts.Port)
compressHandler := handlers.CompressHandler(r)
recoveryHandler := recoveryhandler.NewRecoveryHandler(logger, true)

go func() {
logger.Info("Starting jaeger-query HTTP server", zap.Int("port", queryOpts.Port))
if err := http.ListenAndServe(portStr, recoveryHandler(r)); err != nil {
if err := http.ListenAndServe(portStr, recoveryHandler(compressHandler)); err != nil {
logger.Fatal("Could not launch service", zap.Error(err))
}
hc.Set(http.StatusInternalServerError)
Expand Down

0 comments on commit ce9f725

Please sign in to comment.