Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
actually set calledBack
Browse files Browse the repository at this point in the history
  • Loading branch information
devdazed committed Feb 5, 2014
1 parent 92560aa commit 4c321e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/connection.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function escapeCQL(val) {
throw errors.create(new Error('Invalid Date')); throw errors.create(new Error('Invalid Date'));
} }
// C* < 2.0.2 doesn't work with negative longs // C* < 2.0.2 doesn't work with negative longs
if(_val<0){ if(_val<0){
return "'" + val.getUTCFullYear() return "'" + val.getUTCFullYear()
+ '-' + zero_pad(val.getUTCMonth() + 1) + '-' + zero_pad(val.getUTCMonth() + 1)
+ '-' + zero_pad(val.getUTCDate()) + '-' + zero_pad(val.getUTCDate())
Expand Down Expand Up @@ -399,6 +399,7 @@ Connection.prototype.execute = function(){


timer = setTimeout(function(){ timer = setTimeout(function(){
if(!calledBack){ if(!calledBack){
calledBack = true;
callback(new Error('Read Timed Out')); callback(new Error('Read Timed Out'));
self._connection.connection.destroy(); self._connection.connection.destroy();
} }
Expand All @@ -414,6 +415,7 @@ Connection.prototype.execute = function(){
return; return;
} }


calledBack = true;
if(err){ if(err){
callback(errors.create(err)); callback(errors.create(err));
} else { } else {
Expand Down

0 comments on commit 4c321e2

Please sign in to comment.