Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Yuen <[email protected]>
  • Loading branch information
jessicayuen committed Jul 28, 2020
1 parent d89ee47 commit 37af3c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions internal/app/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,17 @@ func (o *orchestrator) CreateWatch(req gcp.Request) (chan gcp.Response, func())
// If we have a cached response and the version is different,
// immediately push the result to the response channel.
go func() {
responseChannel.addResponse(convertToGcpResponse(cached.Resp, req))
metrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchFanouts).Inc(1)
err := responseChannel.addResponse(convertToGcpResponse(cached.Resp, req))
if err != nil {
// Sanity check that the channel isn't blocked. This shouldn't
// ever happen since the channel is newly created. Regardless,
// continue to create the watch.
o.logger.With("aggregated_key", aggregatedKey, "error", err).Warn(context.Background(),
"failed to push cached response")
metrics.OrchestratorWatchErrorsSubscope(o.scope, aggregatedKey).Counter(metrics.ErrorChannelFull).Inc(1)
} else {
metrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchFanouts).Inc(1)
}
}()
}

Expand Down

0 comments on commit 37af3c5

Please sign in to comment.