Skip to content

Commit

Permalink
Capture err value when activity returns
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin authored Dec 23, 2020
2 parents c917e23 + 2af175b commit 12acd33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Activity(ctx context.Context, scheduledTimeNanos int64) error {
var err error
metricsScope := activity.GetMetricsScope(ctx)
metricsScope, sw := recordActivityStart(metricsScope, "metrics.Activity", scheduledTimeNanos)
defer recordActivityEnd(metricsScope, sw, err)
defer func() { recordActivityEnd(metricsScope, sw, err) }()

time.Sleep(time.Second)
logger.Info("Metrics reported.")
Expand Down

0 comments on commit 12acd33

Please sign in to comment.