FIX: serialize post processing

This avoids all sorts of nasty race conditions in job schedular
This commit is contained in:
Sam 2015-08-14 13:05:13 +10:00
parent c711c06bb8
commit 23b8a408f7

View File

@ -16,12 +16,14 @@ class CookedPostProcessor
end
def post_process(bypass_bump = false)
DistributedMutex.synchronize("post_process_#{@post.id}") do
keep_reverse_index_up_to_date
post_process_images
post_process_oneboxes
optimize_urls
pull_hotlinked_images(bypass_bump)
end
end
def keep_reverse_index_up_to_date
upload_ids = Set.new