Skip to content

Commit

Permalink
Rescue from Redis::CommandErrors
Browse files Browse the repository at this point in the history
Signed-off-by: David Celis <david@davidcelis.com>
  • Loading branch information
David Celis committed Sep 27, 2012
1 parent 1ce8b19 commit 47def2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/recommendable/acts_as_recommended_to.rb
Expand Up @@ -692,13 +692,13 @@ def update_recommendations_for klass
klass.find_each do |object|
next if rated?(object) || !object.been_rated? || ignored?(object) || stashed?(object)

prediction = predict object

begin
prediction = predict object
Recommendable.redis.zadd(predictions_set_for(object.class), prediction, object.redis_key) if prediction
rescue Redis::CommandError
next
end

Recommendable.redis.zadd(predictions_set_for(object.class), prediction, object.redis_key) if prediction
end
end

Expand Down

0 comments on commit 47def2f

Please sign in to comment.