Skip to content

Commit

Permalink
do not limit qps while qps <= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
xujinzheng committed Oct 13, 2015
1 parent ca640f2 commit 76f10af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ func (p *MNSQueue) ChangeMessageVisibility(receiptHandle string, visibilityTimeo

func (p *MNSQueue) checkQPS() {
p.qpsMonitor.Pulse()
for p.qpsMonitor.QPS() > p.qpsLimit {
time.Sleep(time.Millisecond * 10)
if p.qpsLimit > 0 {
for p.qpsMonitor.QPS() > p.qpsLimit {
time.Sleep(time.Millisecond * 10)
}
}
}

0 comments on commit 76f10af

Please sign in to comment.