From d8633b5b6cbcf6695e08fc7895eb14e5c2bcd720 Mon Sep 17 00:00:00 2001 From: saint Date: Sun, 18 Aug 2024 00:10:57 +1000 Subject: [PATCH] v0.42.1 Rewrite and simplication of concurrent-ruby support --- gossamer_forums.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 32298a8..180a866 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1161,16 +1161,17 @@ class GossamerForumsImporter < ImportScripts::Base #### current_post_batch += 1 # Increment, moving to next post in the batch #### break if current_post_batch >= parent_post_count - # Wait for all jobs in the current batch to finish before proceeding - puts "PP 33 -- Ready for shutdown" - pool.shutdown # Initiate thread pool shutdown after all jobs submitted - puts "PP 44 -- Now wait for termination" - pool.wait_for_termination # Wait for all threads to finish exec - # Check if all posts have been processed #### is_complete = true if current_post_batch >= parent_post_count is_complete = parent_post_ids.empty? end + + # Wait for all jobs in the current batch to finish before proceeding + puts "PP 33 -- Ready for shutdown" + pool.shutdown # Initiate thread pool shutdown after all jobs submitted + puts "PP 44 -- Now wait for termination" + pool.wait_for_termination # Wait for all threads to finish exec + end # # Method to ensure thread-safe updates to highest_processed_post_id