FIX: Ignore problems cooking
This commit is contained in:
parent
5422649ba7
commit
976056bc41
|
@ -14,11 +14,15 @@ module Jobs
|
||||||
.find_in_batches do |group|
|
.find_in_batches do |group|
|
||||||
|
|
||||||
group.each do |p|
|
group.each do |p|
|
||||||
# Note we can't use `p.cooked` here because oneboxes have been cooked out
|
begin
|
||||||
cooked = PrettyText.cook(p.raw)
|
# Note we can't use `p.cooked` here because oneboxes have been cooked out
|
||||||
doc = Nokogiri::HTML::fragment(cooked)
|
cooked = PrettyText.cook(p.raw)
|
||||||
if doc.search('a.onebox').size > 0
|
doc = Nokogiri::HTML::fragment(cooked)
|
||||||
to_award[p.user_id] ||= { post_id: p.id, created_at: p.created_at }
|
if doc.search('a.onebox').size > 0
|
||||||
|
to_award[p.user_id] ||= { post_id: p.id, created_at: p.created_at }
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
nil # if there is a problem cooking we don't care
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue