From 23a65c5f5c5633004f8d5d4de4367bf4432d2ca2 Mon Sep 17 00:00:00 2001 From: saint Date: Sun, 18 Aug 2024 01:23:54 +1000 Subject: [PATCH] v0.42.1 Rewrite and simplication of concurrent-ruby support --- gossamer_forums.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 1849d95..505f8d1 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1268,11 +1268,13 @@ class GossamerForumsImporter < ImportScripts::Base sanitized_post_message = sanitize_post_message(row['post_message']) puts "CREATE TOPIC POST topic.id #{topic.id} discourse_user_id #{discourse_user_id}" - + + post_number = 0 sqlite_mutex.synchronize do # Increment the post count for the topic post_number = fetch_db_topic_post_numbers(topic.id).to_i + 1 update_db_topic_post_numbers(topic.id, post_number) + end puts "TIJ GG post_id #{post_id}" @@ -1288,7 +1290,6 @@ class GossamerForumsImporter < ImportScripts::Base ) post.custom_fields['original_gossamer_id'] = row['post_id'] post.save! - end sqlite_mutex.synchronize do # Increment the post count for the topic and user