mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
added back load but with greater delay (random up to a sec between id's)
This commit is contained in:
parent
d51ecd5115
commit
df1886f8a2
2 changed files with 2 additions and 8 deletions
|
|
@ -394,17 +394,11 @@ func (self *Brand) Load(requestChan chan Command, f *Fragment) {
|
|||
//log.Println("Bad mojo")
|
||||
}
|
||||
time.Sleep(time.Duration(rand.Intn(15)) * time.Second) //trying to avoid mass cassandra hit
|
||||
counter := 0
|
||||
for _, k := range keys {
|
||||
request := NewLoadRequest(k)
|
||||
requestChan <- request
|
||||
request.Response()
|
||||
counter++
|
||||
if counter > 100 {
|
||||
backoff := (counter / 100) * 100
|
||||
|
||||
time.Sleep(time.Duration(backoff) * time.Millisecond) //trying to avoid mass cassandra hit
|
||||
}
|
||||
time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) //trying to avoid mass cassandra hit
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ func (self *FragmentContainer) AddFragment(db string, frame string, slice int, i
|
|||
loader := make(chan Command)
|
||||
self.fragments[id] = f
|
||||
go f.ServeFragment(loader)
|
||||
//go f.Load(loader)
|
||||
go f.Load(loader)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue