Skip to content

Commit

Permalink
fix set zero value
Browse files Browse the repository at this point in the history
  • Loading branch information
gamoutatsumi committed Apr 16, 2024
1 parent 47c42b5 commit bed4cae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/pkg/api/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ func allocatePooledInstance(ctx context.Context, targets []lxdclient.LXDHost, re

for _, i := range s {
l := l.With("stadium", i.Host.HostConfig.LxdHost, "instance", i.InstanceName)
metric.FailedLxdAllocate.WithLabelValues(i.Host.HostConfig.LxdHost, runnerName).Set(0)
if err := allocateInstance(i.Host, i.InstanceName, runnerName, l); err != nil {
l.Info("failed to allocate instance (trying another instance)", "err", err)
metric.FailedLxdAllocate.WithLabelValues(i.Host.HostConfig.LxdHost, runnerName).Set(1)
continue
}
metric.FailedLxdAllocate.WithLabelValues(i.Host.HostConfig.LxdHost, runnerName).Set(0)
return i.Host, i.InstanceName, nil
}

Expand Down

0 comments on commit bed4cae

Please sign in to comment.