Skip to content

Commit

Permalink
fix(zero): fix waiting for random time while rate limiting (#8656)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-dgraph committed Feb 8, 2023
1 parent a153ed5 commit 3c100d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dgraph/cmd/zero/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (s *Server) AssignIds(ctx context.Context, num *pb.Num) (*pb.AssignedIds, e
// Return error after random delay.
//nolint:gosec // random generator in closed set does not require cryptographic precision
delay := rand.Intn(int(opts.limiterConfig.RefillAfter))
time.Sleep(time.Duration(delay) * time.Second)
time.Sleep(time.Duration(delay))
return errors.Errorf("Cannot lease UID because UID lease for the namespace %#x is "+
"exhausted. Please retry after some time.", ns)
}
Expand Down

0 comments on commit 3c100d5

Please sign in to comment.