Skip to content
Browse files

Specify default read and write consistency for cassandra backend.

  • Loading branch information...
1 parent 1edb32f commit 0e1c127445fd266741373de9438f90322ce678a1 @Kami Kami committed Apr 30, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/db/backends/cassandra.js
View
7 lib/db/backends/cassandra.js
@@ -18,6 +18,9 @@
var cassandra = require('cassandra-client');
var log = require('logmagic').local('lib.db.backends.cassandra');
+var DEFAULT_READ_CONSISTENCY = 'ONE';
+var DEFAULT_WRITE_CONSISTENCY = 'ONE';
+
/**
* Cassandra client.
@@ -33,8 +36,8 @@ var CassandraClient = function(options) {
this._hosts = options.hosts;
this._keyspace = options.keyspace;
this._columnFamily = options.column_family;
- this._readConsistency = options.read_consistency;
- this._writeConsistency = options.write_consistency;
+ this._readConsistency = options.read_consistency || DEFAULT_READ_CONSISTENCY;
+ this._writeConsistency = options.write_consistency || DEFAULT_WRITE_CONSISTENCY;
this._rowKey = 'rproxy';

0 comments on commit 0e1c127

Please sign in to comment.
Something went wrong with that request. Please try again.