FIX: prevent infinite loop in PullHotlinkedImages job

This commit is contained in:
Régis Hanol 2015-10-30 22:46:46 +01:00
parent 7eafca8f9d
commit 5e3da94c46
1 changed files with 1 additions and 6 deletions

View File

@ -76,12 +76,7 @@ module Jobs
end end
post.reload post.reload
if start_raw != post.raw if start_raw == post.raw && raw != post.raw
# post was edited - start over (after 10 minutes)
backoff = args.fetch(:backoff, 1) + 1
delay = SiteSetting.ninja_edit_window * args[:backoff]
Jobs.enqueue_in(delay.seconds.to_i, :pull_hotlinked_images, args.merge!(backoff: backoff))
elsif raw != post.raw
changes = { raw: raw, edit_reason: I18n.t("upload.edit_reason") } changes = { raw: raw, edit_reason: I18n.t("upload.edit_reason") }
# we never want that job to bump the topic # we never want that job to bump the topic
options = { bypass_bump: true } options = { bypass_bump: true }