mranney/node_redis — Issue #174: Possible issue with client timeout and expiring keys?
Author: domino14
Created: 2012-02-12 23:07:25+00:00
State: open

Here's a simple test case. The two files below with a default redis server (with 5-minute idle timeout). Run the files as separate node programs. The second file will print "result 1" and then 400 seconds later, "result null", even though the key is there and has not expired (since the key gets reset every 30 seconds).

Am I doing something wrong?

```javascript

var redis = require('redis');

client = redis.createClient(6379, "ec2-204-236-175-36.us-west-1.compute.amazonaws.com");
client.select(2);

function setkey() {
client.set('abcdef', 1);
client.expire('abcdef', 60);
}
setkey();
setInterval(setkey, 30000);
```

```javascript
var redis = require('redis');
client = redis.createClient();
client.select(2);

function getKey() {
client.get('abcdef', function(err, result) {
console.log('result', result);
});
}
getKey();
setInterval(getKey, 400000);
```