FIX: Some extra safety - in the case that an imported post was deleted,
don't error out of the PollFeed job
This commit is contained in:
parent
773cf60224
commit
5fb962a65f
|
@ -49,7 +49,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||||
absolutize_urls(url, contents)
|
absolutize_urls(url, contents)
|
||||||
post = embed.post
|
post = embed.post
|
||||||
# Update the topic if it changed
|
# Update the topic if it changed
|
||||||
if content_sha1 != embed.content_sha1
|
if post && content_sha1 != embed.content_sha1
|
||||||
revisor = PostRevisor.new(post)
|
revisor = PostRevisor.new(post)
|
||||||
revisor.revise!(user, absolutize_urls(url, contents), skip_validations: true, bypass_rate_limiter: true)
|
revisor.revise!(user, absolutize_urls(url, contents), skip_validations: true, bypass_rate_limiter: true)
|
||||||
embed.update_column(:content_sha1, content_sha1)
|
embed.update_column(:content_sha1, content_sha1)
|
||||||
|
|
Loading…
Reference in New Issue