v0.39.7 Fixes/tweaks in calculate_dynamic_pool_size

This commit is contained in:
David Sainty 2024-08-17 03:27:17 +10:00
parent 1f09322207
commit c11055d0f4

View File

@ -1138,7 +1138,7 @@ class GossamerForumsImporter < ImportScripts::Base
#this parts needs to be synchronously to avoid race conditions #this parts needs to be synchronously to avoid race conditions
# Fetch the post data for the given post_id (this is the first post in the topic) # Fetch the post data for the given post_id (this is the first post in the topic)
row = execute_query("SELECT post_id, user_id_fk, forum_id_fk, post_root_id, post_subject, post_time, post_message, post_father_id, post_likes, post_replies FROM gforum_Post WHERE post_id = #{post_id}").first row = execute_query("SELECT post_id, user_id_fk, forum_id_fk, post_root_id, post_subject, post_time, post_message, post_father_id, post_replies FROM gforum_Post WHERE post_id = #{post_id}").first
# Early return if the post data is not found # Early return if the post data is not found
return unless row return unless row
@ -1216,7 +1216,6 @@ class GossamerForumsImporter < ImportScripts::Base
raw: sanitized_post_message, raw: sanitized_post_message,
created_at: Time.at(row['post_time']), created_at: Time.at(row['post_time']),
updated_at: Time.at(row['post_time']), updated_at: Time.at(row['post_time']),
like_count: row['post_likes'] || 0,
reads: post_views || 0, reads: post_views || 0,
post_number: post_number post_number: post_number
) )
@ -1235,7 +1234,7 @@ class GossamerForumsImporter < ImportScripts::Base
insert_url_mapping(row['post_id'], new_url, unique_title) insert_url_mapping(row['post_id'], new_url, unique_title)
# Now fetch and import all replies to this topic # Now fetch and import all replies to this topic
replies = execute_query("SELECT post_id, user_id_fk, post_message, post_time, post_likes FROM gforum_Post WHERE post_root_id = #{post_id} ORDER BY post_time ASC") replies = execute_query("SELECT post_id, user_id_fk, post_message, post_time, FROM gforum_Post WHERE post_root_id = #{post_id} ORDER BY post_time ASC")
# Import each reply sequentially # Import each reply sequentially
replies.each do |reply_row| replies.each do |reply_row|
@ -1259,7 +1258,6 @@ class GossamerForumsImporter < ImportScripts::Base
raw: sanitized_reply_message, raw: sanitized_reply_message,
created_at: Time.at(reply_row['post_time']), created_at: Time.at(reply_row['post_time']),
updated_at: Time.at(reply_row['post_time']), updated_at: Time.at(reply_row['post_time']),
like_count: reply_row['post_likes'] || 0,
post_number: post_number post_number: post_number
) )
post.custom_fields['original_gossamer_id'] = reply_row['post_id'] post.custom_fields['original_gossamer_id'] = reply_row['post_id']