Skip to content

Commit

Permalink
fix: reuse market member
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangliang committed Jan 11, 2022
1 parent 3c96015 commit 792186d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/agent/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ func (h *Market) InviteOneLike(like func(One) bool) One {
}

func(h *Market) InviteOne() One {
select {
case one := <-h.hub:
h.UseOne(one)
return one
case <-time.After(time.Millisecond * 10):
return nil
}
return h.InviteOneLike(nil)
}

func (h *Market) reset() {
Expand Down

0 comments on commit 792186d

Please sign in to comment.