null
EXEC のコールバックがいくつかの値をsとしてランダムに返すという問題があります。
ほとんどの場合、コードは正常に動作しますが、ランダムに失敗します (または、ブラウザーを繰り返し更新すると)...
失敗するところまで縮めたコードを次に示します。
var transaction = client.multi();
reply.forEach(function (id) { // reply always equals [ 'mykey1', 'mykey2' ]
transaction.hgetall(namespace + ":" + id);
});
transaction.exec(function (err, replies) {
// 'replies' sometimes returns all the responses properly,
// other times it returns some of the values as null
// See the examples I wrote below
});
正常に動作すると、exec コールバックは次を返します。
[{
owner: '123',
id: 'asdasdasd',
name: 'asdasdasd',
created_at: '2012-10-06T09:26:25.596Z',
updated_at: '2012-10-06T09:28:54.929Z'
},
{
owner: '456',
id: 'asdfsdfasdf',
name: 'asdfsdfasdf',
created_at: '2012-10-06T09:27:19.251Z',
updated_at: '2012-10-06T09:28:03.116Z'
}]
動作しない場合、これを返します: (null
値に注意してください)
[{
owner: '123',
id: 'asdasdasd',
name: 'asdasdasd',
created_at: '2012-10-06T09:26:25.596Z',
updated_at: '2012-10-06T09:28:54.929Z'
}, null]