redisClient.get('abc', function(err, abcValue){
console.log(abcValue);
abcValue = abcValue + 'id';
redisClient.set('abc', abcValue, function(err){
console.log('abc updated');
});
});在网络上嵌套更新,打印'abc更新‘,但实际值不更新在redis数据库。
注意:-上面的代码在本地主机上工作,但是更新没有显示在heroku-redistogo上。
编辑:-我正在本地主机上运行代码,并将redis连接到Redistogo。使用下列代码:
设立特别会议:-
app.use(express.session({
store: new RedisStore({
host: 'birdeye.redistogo.com',
port: 1384,
db: 'redistogo',
pass: '052940128c2f2452f73378588dd5fb129'
}),
secret: '1234567890QWERTY',
}));我还使用以下代码创建另一个redisClient:
var redisClient = require('redis').createClient( 1384, 'birdeye.redistogo.com', {detect_buffers: true});
redisClient.auth('052940128c2f2452f73378588dd5fb129', function() {
console.log('Redis client connected');
});发布于 2013-12-03 10:33:51
在Heroku上运行此代码时,您看到控制台中的abc updated吗?这似乎是Redis客户端的错误配置。
https://stackoverflow.com/questions/20334805
复制相似问题