correct retry logic

This commit is contained in:
Sam 2015-08-24 10:28:38 +10:00
parent 6451495ec6
commit 84fdc655ad

View File

@ -395,7 +395,7 @@ class User < ActiveRecord::Base
create_visit_record!(now.to_date, posts_read: num_posts, mobile: opts.fetch(:mobile, false))
rescue ActiveRecord::RecordNotUnique
if !_retry
update_posts_read!(num_posts, now, _retry=true)
update_posts_read!(num_posts, opts.merge( retry: true ))
else
raise
end