v0.42.1 Rewrite and simplication of concurrent-ruby support
This commit is contained in:
parent
678012f76a
commit
fed7a8935e
@ -1138,7 +1138,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
if post_status.nil? || post_status == 0
|
||||
puts "Starting import for post_id #{post_id}"
|
||||
topic_import_job(post_id, mysql_client, sqlite_mutex) # Import topic and its replies
|
||||
sqlite_mutex.sychronize do
|
||||
sqlite_mutex.synchronize do
|
||||
mark_post_as_complete(post_id) # Mark as complete in SQLite table
|
||||
end
|
||||
else
|
||||
@ -1147,7 +1147,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
end
|
||||
rescue => e
|
||||
puts "Error processing post ID #{post_id}: #{e.message}"
|
||||
sqlite_mutex.sychronize do
|
||||
sqlite_mutex.synchronize do
|
||||
mark_post_as_failed(post_id)
|
||||
end
|
||||
ensure
|
||||
@ -1250,7 +1250,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
end
|
||||
end
|
||||
|
||||
sqlite_mutex.sychronize do
|
||||
sqlite_mutex.synchronize do
|
||||
# Update the database with the last post time and user for the topic
|
||||
update_db_topic_last_post_time(topic.id, Time.at(row['post_time']).to_i)
|
||||
update_db_topic_last_post_user(topic.id, discourse_user_id)
|
||||
@ -1285,7 +1285,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
post.custom_fields['original_gossamer_id'] = row['post_id']
|
||||
post.save!
|
||||
|
||||
sqlite_mutex.sychronize do
|
||||
sqlite_mutex.synchronize do
|
||||
# Increment the post count for the topic and user
|
||||
update_db_topic_post_count(topic.id, fetch_db_topic_post_count(topic.id).to_i + 1)
|
||||
update_db_user_post_count(discourse_user_id, fetch_db_user_post_count(discourse_user_id).to_i + 1)
|
||||
@ -1314,7 +1314,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
|
||||
puts "CREATE REPLY in topic_id #{topic.id}"
|
||||
|
||||
sqlite_mutex.sychronize do
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user