Skip to content

Commit

Permalink
Updating to now use a default client for the outbound senders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holaday, Sean authored and Holaday, Sean committed Mar 28, 2017
1 parent f9922b6 commit 3d2f26a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/caduceus/caduceus.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"crypto/tls"
"fmt"
"github.com/Comcast/webpa-common/concurrent"
"github.com/Comcast/webpa-common/handler"
Expand All @@ -10,6 +11,7 @@ import (
"github.com/justinas/alice"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"net/http"
"os"
"os/signal"
"time"
Expand Down Expand Up @@ -54,6 +56,9 @@ func caduceus(arguments []string) int {
QueueSize: caduceusConfig.ProfilerQueueSize,
}

tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
timeout := time.Duration(caduceusConfig.SenderClientTimeout) * time.Second

// declare a new sender wrapper and pass it a profiler factory so that it can create
// unique profilers on a per outboundSender basis
caduceusSenderWrapper, err := SenderWrapperFactory{
Expand All @@ -63,8 +68,7 @@ func caduceus(arguments []string) int {
Linger: time.Duration(caduceusConfig.SenderLinger) * time.Second,
ProfilerFactory: caduceusProfilerFactory,
Logger: logger,
// TODO: ask Wes how I should be setting this
// Client: ,
Client: &http.Client{Transport: tr, Timeout: timeout},
}.New()

if err != nil {
Expand Down
1 change: 1 addition & 0 deletions src/caduceus/caduceus_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type CaduceusConfig struct {
SenderQueueSizePerSender int
SenderCutOffPeriod int
SenderLinger int
SenderClientTimeout int
ProfilerFrequency int
ProfilerDuration int
ProfilerQueueSize int
Expand Down

0 comments on commit 3d2f26a

Please sign in to comment.