Skip to content

Commit

Permalink
Merge pull request #31 from Comcast/feature/bugFixes
Browse files Browse the repository at this point in the history
changed how caduceusSenderWrapper gets its updates
  • Loading branch information
schmidtw authored Jul 27, 2017
2 parents a1ec90f + a152e6e commit cc383cf
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/caduceus/caduceus.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func caduceus(arguments []string) int {

// declare a new sender wrapper and pass it a profiler factory so that it can create
// unique profilers on a per outboundSender basis
// TODO: need to add `Update` method into the code
caduceusSenderWrapper, err := SenderWrapperFactory{
NumWorkersPerSender: caduceusConfig.SenderNumWorkersPerSender,
QueueSizePerSender: caduceusConfig.SenderQueueSizePerSender,
Expand Down Expand Up @@ -171,9 +170,9 @@ func caduceus(arguments []string) int {
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating new webhook factory: %s\n", err)
return 1
}

}
webhookRegistry, webhookHandler := webhookFactory.NewRegistryAndHandler()
webhookFactory.SetExternalUpdate(caduceusSenderWrapper.Update)

// register webhook end points for api
mux.Handle("/hook", caduceusHandler.ThenFunc(webhookRegistry.UpdateRegistry))
Expand Down Expand Up @@ -213,14 +212,6 @@ func caduceus(arguments []string) int {
caduceusSenderWrapper.Update(webhookStartResults.Hooks)
}

// monitor used to update sender wrapper list by listening to webhookRegistry.m.changes
go func() {
for {
updateSenderWrapperlist := <-webhookRegistry.Changes
caduceusSenderWrapper.Update(updateSenderWrapperlist)
}
}()

var (
signals = make(chan os.Signal, 1)
)
Expand Down

0 comments on commit cc383cf

Please sign in to comment.