From df1886f8a296222346ab826613d8c3bf55605809 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 10 Nov 2014 22:05:09 +0000 Subject: [PATCH] added back load but with greater delay (random up to a sec between id's) --- index/brand.go | 8 +------- index/fragment_container.go | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/index/brand.go b/index/brand.go index 3dd63854d..b7571e4d5 100644 --- a/index/brand.go +++ b/index/brand.go @@ -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 } } diff --git a/index/fragment_container.go b/index/fragment_container.go index e03e3a4cb..6449be3fc 100644 --- a/index/fragment_container.go +++ b/index/fragment_container.go @@ -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) } }