You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ca...@codespot.com on 2011/12/16 17:48:17 UTC

[cassandra-node] push by gdusbabek@gmail.com - sentinel -> timeoutId on 2011-12-16 16:47 GMT

Revision: 355b1977c1de
Author:   gdusbabek <gd...@gmail.com>
Date:     Fri Dec 16 08:46:02 2011
Log:      sentinel -> timeoutId

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=355b1977c1de

Modified:
  /lib/driver.js

=======================================
--- /lib/driver.js	Fri Dec 16 06:12:33 2011
+++ /lib/driver.js	Fri Dec 16 08:46:02 2011
@@ -402,15 +402,15 @@
      var login = function(cb) {
        if (self.connectionInfo.user || self.connectionInfo.pass) {
          var creds = new ttypes.AuthenticationRequest({user:  
self.connectionInfo.user, password: self.connectionInfo.pass});
-        var sentinel = setTimeout(function() {
-          if (sentinel) {
-            sentinel = null;
+        var timeoutId = setTimeout(function() {
+          if (timeoutId) {
+            timeoutId = null;
              cb(decorateErrWithErrno(new Error('login timed out'),  
constants.ETIMEDOUT));
            }
          }, DEFAULT_STEP_TIMEOUTS.login);
          self.client.login(creds, function(err) {
-          if (sentinel) {
-            sentinel = clearTimeout(sentinel);
+          if (timeoutId) {
+            timeoutId = clearTimeout(timeoutId);
              if (err) { amendError(err); }
              cb(err);
            }
@@ -422,15 +422,15 @@

      // 2) login.
      var learn = function(cb) {
-      var sentinel = setTimeout(function() {
-        if (sentinel) {
-          sentinel = null;
+      var timeoutId = setTimeout(function() {
+        if (timeoutId) {
+          timeoutId = null;
            cb(decorateErrWithErrno(new Error('learn timed out'),  
constants.ETIMEDOUT));
          }
        }, DEFAULT_STEP_TIMEOUTS.learn);
        self.client.describe_keyspace(self.connectionInfo.keyspace,  
function(err, def) {
-        if (sentinel) {
-          sentinel = clearTimeout(sentinel);
+        if (timeoutId) {
+          timeoutId = clearTimeout(timeoutId);
            if (err) {
              amendError(err);
              cb(err);
@@ -457,14 +457,14 @@

      // 3) set the keyspace on the server.
      var use = function(cb) {
-      var sentinel = setTimeout(function() {
-        sentinel = null;
+      var timeoutId = setTimeout(function() {
+        timeoutId = null;
          cb(decorateErrWithErrno(new Error('use timed out'),  
constants.ETIMEDOUT));
        }, DEFAULT_STEP_TIMEOUTS.use);

        self.client.set_keyspace(self.connectionInfo.keyspace, function(err)  
{
-        if (sentinel) {
-          sentinel = clearTimeout(sentinel);
+        if (timeoutId) {
+          timeoutId = clearTimeout(timeoutId);
            if (err) { amendError(err); }
            cb(err);
          }