Skip to content

Commit

Permalink
Merge pull request scylladb#366 from Zariel/batch-consistency
Browse files Browse the repository at this point in the history
Inherit consistency from session in NewBatch
  • Loading branch information
0x6e6562 committed Apr 15, 2015
2 parents 75dba14 + cd7d08d commit 1ff8661
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ func NewBatch(typ BatchType) *Batch {

// NewBatch creates a new batch operation using defaults defined in the cluster
func (s *Session) NewBatch(typ BatchType) *Batch {
return &Batch{Type: typ, rt: s.cfg.RetryPolicy, serialCons: s.cfg.SerialConsistency}
s.mu.RLock()
batch := &Batch{Type: typ, rt: s.cfg.RetryPolicy, serialCons: s.cfg.SerialConsistency, Cons: s.cons}
s.mu.RUnlock()
return batch
}

// Attempts returns the number of attempts made to execute the batch.
Expand Down

0 comments on commit 1ff8661

Please sign in to comment.