Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ruby1.9でredisgemを使用しています
Redis.pipelined内でRedis例外をキャッチして、残りのバッチも確実に実行されるようにすることは可能ですか?
redis.pipelined do begin redis.hGet ...rescue Redis :: ComandError ... end endを試しましたが、rescueコードが実行されません。
rescue
マルチは、各操作がアトミックであることを除いて、パイプラインと同様に機能するようです。私の「aaa」キーは、メンバーが例外をスローした場合でも設定されました。uはブロック内の例外を処理できないため、これはあなたが探していたものではないことを私は知っています。
#> $redis.multi do *> $redis.set "asdf", 1 *> $redis.smembers "asdf" *> $redis.set "aaa", 2 *> end