throttle flood errors like previous hub did
This commit is contained in:
parent
9edba6109f
commit
d71e91c58e
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"math"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
//"github.com/lbryio/hub/schema"
|
||||
|
||||
|
@ -328,6 +329,7 @@ func (s *Server) checkQuery(in *pb.SearchRequest) error {
|
|||
}
|
||||
for name, failed := range checks {
|
||||
if failed {
|
||||
time.Sleep(2) // throttle
|
||||
return errors.New(fmt.Sprintf("%s cant have more than %d items.", name, limit))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue