Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f342d10

Browse files
authored
fix(enterprise/coderd/proxyhealth): properly defer healthCheckDuration observe (#10848)
1 parent 78df683 commit f342d10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

enterprise/coderd/proxyhealth/proxyhealth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (p *ProxyHealth) ProxyHosts() []string {
215215
// unreachable.
216216
func (p *ProxyHealth) runOnce(ctx context.Context, now time.Time) (map[uuid.UUID]ProxyStatus, error) {
217217
// Record from the given time.
218-
defer p.healthCheckDuration.Observe(time.Since(now).Seconds())
218+
defer func() { p.healthCheckDuration.Observe(time.Since(now).Seconds()) }()
219219

220220
//nolint:gocritic // Proxy health is a system service.
221221
proxies, err := p.db.GetWorkspaceProxies(dbauthz.AsSystemRestricted(ctx))

0 commit comments

Comments
 (0)