Browse files

Rescue from Redis::CommandErrors

Signed-off-by: David Celis <david@davidcelis.com>
  • Loading branch information...
1 parent 1ce8b19 commit 47def2fa08b3c5579521a60dfda50f487d580a59 @davidcelis committed Sep 26, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/recommendable/acts_as_recommended_to.rb
View
6 lib/recommendable/acts_as_recommended_to.rb
@@ -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

0 comments on commit 47def2f

Please sign in to comment.