Skip to content

Commit

Permalink
Fix streak length metric reporting (#5172)
Browse files Browse the repository at this point in the history
* Don't use `defer` for streak length reporting

Signed-off-by: Thomas Newton <[email protected]>

* Make it work with defer

Signed-off-by: Thomas Newton <[email protected]>

* Fix lint

Signed-off-by: Thomas Newton <[email protected]>

---------

Signed-off-by: Thomas Newton <[email protected]>
  • Loading branch information
Tom-Newton authored Apr 5, 2024
1 parent 24a6e4e commit 14eaa16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flytepropeller/pkg/controller/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (p *Propeller) Handle(ctx context.Context, namespace, name string) error {
}

streak := 0
defer p.metrics.StreakLength.Add(ctx, float64(streak))
defer func() { p.metrics.StreakLength.Add(ctx, float64(streak)) }()

maxLength := p.cfg.MaxStreakLength
if maxLength <= 0 {
Expand Down

0 comments on commit 14eaa16

Please sign in to comment.