How to use the redis.saveClient.close function in redis

To help you get started, we’ve selected a few redis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pilif / tempalias / util / consume.js View on Github external
aliasProvider.findById(process.argv[2], true, function(alias){
  sys.puts(sys.inspect(alias));
  client.close();
});
github pilif / tempalias / garbage_collect.js View on Github external
redis.keys('lock:*', function(locks){
    var i = 0, garbage = [], gc=0;
    if (!locks){
      sys.puts("No locks found");
      redis.close();
      return;
    }
    for (i = 0; i < locks.length; i++){
      (function(lockset){
        redis.get(lockset, function(exp){
          gc++;
          if (exp < (new Date()).getTime()){
            garbage.unshift(lockset);
          }
          if (gc >= locks.length){
            if (garbage.length > 0){
              sys.puts("Pruning: "+garbage.join(', '));
              garbage[garbage.length] = function(data){
                sys.puts(data + ' sets removed');
                redis.close();
              };