Updated to avoid reconnecting to redis unnecessarily.