statement.cancel seems to have no effect #31

Open
tony-o opened this Issue Sep 11, 2012 · 0 comments

Comments

Projects
None yet
1 participant

tony-o commented Sep 11, 2012

Don't know if this project is being maintained anymore but canceling the statement seems to have no effect:

    var timeout;
    var done = function(d){
      clearTimeout(timeout);
      log(0,"rows:\t" + rows + "\t" + errors + "\t" + (rows+errors));
      log("statement closing, rows: " + rows);
      callback();
    };
    statement.on("row",function(row){
      try{
        rows++;
        clearTimeout(timeout);
        timeout = setTimeout(function(){
          statement.cancel();
          log(2,"timeout situation, attempting to kill");
        },1500);
      }catch(e){ log(2,e); }
    });
    log("executing");
    statement.on("error",function(e){
      log(2,e);
      errors++;
    });
    statement.on("done",function(d){
      done();
    });
    statement.execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment