Railsでredis-rbを使ってRedisに接続するアプリを作る場合、Railsアプリの初期化時にRedisに接続を行うことが多いと思います。/app/config/initializers/redis.rbのようなファイルの中で$redis = Redis.newにより接続を準備しますが、Redis.newはRedisクラスのオブジェクトを作成するだけなので、仮に接続のための設定に誤りがあったりRedisのサーバー自体が起動していなくても例外になりません。すると、Railsのアプリ本体のコードのどこかで後に$redisを使ってDBへの接続やpub/subなどを行った時点で突然例外が発生することになります。このような事態を避けるためには、/app/config/initializers/redis.rbの中で$redis = Redis.newを行った直後に$redis.pingを実行
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く