From 09955265b4d7fe1c8a68ad2a5c4b5a862144db2a Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Sat, 21 Jun 2014 00:35:01 -0500 Subject: [PATCH] fixed batch issue with cassandra --- index/storage_cass.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index/storage_cass.go b/index/storage_cass.go index 4b29490ec..6733fe832 100644 --- a/index/storage_cass.go +++ b/index/storage_cass.go @@ -51,6 +51,7 @@ func NewCassStorage() Storage { obj.db = session obj.stmt = `INSERT INTO bitmap ( bitmap_id, db, frame, slice , filter, ChunkKey, BlockIndex, block) VALUES (?,?,?,?,?,?,?,?);` obj.batch = nil + obj.batch_time = time.Now() obj.batch_counter = 0 return obj } @@ -119,7 +120,7 @@ func (self *CassandraStorage) EndBatch() { start := time.Now() if self.batch != nil { last := time.Since(self.batch_time) - if last*time.Second > 15 { + if last.Seconds() > 15 { self.FlushBatch() } else if self.batch_counter > 300 { self.FlushBatch()