Skip to content

Commit

Permalink
Merge 28e2ad0 into e668e50
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktur100 committed Jan 7, 2020
2 parents e668e50 + 28e2ad0 commit 8d8ce05
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 57 deletions.
16 changes: 8 additions & 8 deletions codegen/template_bundle/template_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions codegen/templates/tchannel_endpoint.tmpl
Expand Up @@ -244,10 +244,14 @@ func (h *{{$handlerName}}) redirectToDeputy(
"{{.ThriftService}}::{{.Name}}": "{{$methodName}}",
}

sub := h.Deps.Default.Channel.GetSubChannel(serviceName, tchannel.Isolated)
sub.Peers().Add(hostPort)
deputyChannel, err := tchannel.NewChannel(serviceName, nil)
if err != nil {
h.Deps.Default.ContextLogger.Error(ctx, "Deputy Failure", zap.Error(err))
}
defer deputyChannel.Close()
deputyChannel.Peers().Add(hostPort)
client := zanzibar.NewTChannelClientContext(
h.Deps.Default.Channel,
deputyChannel,
h.Deps.Default.Logger,
h.Deps.Default.ContextMetrics,
h.Deps.Default.ContextExtractor,
Expand All @@ -262,10 +266,6 @@ func (h *{{$handlerName}}) redirectToDeputy(
)

success, respHeaders, err := client.Call(ctx, "{{.ThriftService}}", "{{$methodName}}", reqHeaders, req, res)
// hostPort is added above, so there should not be any error returned for the
// following line
// nolint
_ = sub.Peers().Remove(hostPort)
return success, res, respHeaders, err
}
{{end -}}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8d8ce05

Please sign in to comment.