Skip to content

Commit

Permalink
Added stringent type check to rr
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelycode committed Aug 30, 2016
1 parent 902d12a commit fb497c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions distributed_rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ import (
"time"
)

// TODO:
/*
2. Add rate check to init so that we have a load indication
*/

var DRLManager drl.DRL

func SetupDRL() {
Expand Down
7 changes: 7 additions & 0 deletions round_robin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ type RoundRobin struct {
}

func (r *RoundRobin) SetMax(rp interface{}) {
switch rp.(type) {
case *[]string:
r.max = len(*rp.(*[]string)) - 1
case []string:
r.max = len(rp.([]string)) - 1
}

r.max = len(*rp.(*[]string)) - 1

if r.max < 0 {
Expand Down

0 comments on commit fb497c4

Please sign in to comment.