mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
Fix rate limit and runner registration logic (#309)
* errors.Is compares all members of a struct to return true which never happened * switched to type check instead of exact value check * notRegistered was using double negation in if statement which lead to unregistering runners after the registration timeout
This commit is contained in:
@@ -287,7 +287,7 @@ type RunnerNotFound struct {
|
||||
runnerName string
|
||||
}
|
||||
|
||||
func (e RunnerNotFound) Error() string {
|
||||
func (e *RunnerNotFound) Error() string {
|
||||
return fmt.Sprintf("runner %q not found", e.runnerName)
|
||||
}
|
||||
|
||||
@@ -303,5 +303,5 @@ func (r *Client) IsRunnerBusy(ctx context.Context, enterprise, org, repo, name s
|
||||
}
|
||||
}
|
||||
|
||||
return false, RunnerNotFound{runnerName: name}
|
||||
return false, &RunnerNotFound{runnerName: name}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user