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:
Johannes Nicolai
2021-02-15 01:36:49 +01:00
committed by GitHub
parent 34c6c3d9cd
commit bc8bc70f69
3 changed files with 29 additions and 30 deletions

View File

@@ -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}
}