Improve Gathering error handling

Gather only asserted that it wasn't GatheringStateGathering. This
meant that if gathering was complete it would allow multiple runs.
This commit is contained in:
Sean DuBois
2019-05-29 16:43:32 -07:00
parent ce0a3bd08b
commit a58a281d3a
+1 -1
View File
@@ -97,7 +97,7 @@ func (a *Agent) GatherCandidates() error {
gatherErrChan := make(chan error, 1)
runErr := a.run(func(agent *Agent) {
if a.gatheringState == GatheringStateGathering {
if a.gatheringState != GatheringStateNew {
gatherErrChan <- ErrMultipleGatherAttempted
return
} else if a.onCandidateHdlr == nil {