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