FIX: Skip posts that error in historical job (#49)

FIX: Skip posts that error in historical job (#49)

diff --git a/app/jobs/regular/correct_historical_category_expert_posts.rb b/app/jobs/regular/correct_historical_category_expert_posts.rb
index 0284e6b..9198476 100644
--- a/app/jobs/regular/correct_historical_category_expert_posts.rb
+++ b/app/jobs/regular/correct_historical_category_expert_posts.rb
@@ -23,7 +23,14 @@ module Jobs
             .where(topic: { category_id: category_id })
 
           posts.each do |post|
-            CategoryExperts::PostHandler.new(post: post).process_new_post(skip_validations: true)
+            begin
+              CategoryExperts::PostHandler
+                .new(post: post)
+                .process_new_post(skip_validations: true)
+            rescue
+              Rails.logger.warn("Error saving post with ID #{post.id} in correct_historical_category_expert_posts job")
+              next
+            end
           end
         end
     end

GitHub sha: 9bdb692b69437ded91f157418cafc4e0f2cdc72d

This commit appears in #49 which was approved by pmusaraj. It was merged by markvanlan.