1
누구든지이 테스트 코드에 어떤 문제가 있다고 말할 수 있습니까? 이 프로그램은 초기에는 잘 작동하지만 필연적으로 몇 시간 동안 사용하지 않으면 Redis 시간 초과 오류가 발생합니다. 참고로이 게시물의 redis 호스트와 암호를 잘못된 정보로 변경했습니다.Redis timeout error
node-redis 또는 iris-redis 드라이버 사용 여부에 관계없이 동일한 오류가 발생합니다.
var express = require('express');
var app = express();
// Redis Data Store
var redis = require("iris-redis");
var client = redis.createClient(6379, "nodejitsudb5555563948.redis.irstack.com");
client.auth("fehehyrj971946ef332e975fbebb4");
client.on("ready", function() {
client.iris_config(function(er, config) {
if(er) throw er;
console.log("Got my server config: %j", config)
// client.quit()
});
});
// Define a test route
app.get('/test', function(req, res) {
client.incr("seq:test", function(err, reply) {
console.log("Incremented redis counter: " + reply);
var body = "Incremented Redis Counter: " + reply;
res.setHeader('Content-Type', 'text/plain');
res.setHeader('Content-Length', body.length);
res.end(body);
});
});
app.listen(8001);
console.log('Listening on port 8001');
:
이이 그런 다음 레디 스 설정 파일에 다음 줄을 설정하는 것을 잊지 마세요 redis 서버에서 CONFIG GET timeout의 결과는 무엇입니까? –