feat(perf): Cache labels on the conversation model (#8527)

This commit is contained in:
Pranav Raj S
2023-12-11 18:27:55 -08:00
committed by GitHub
parent 79412ba2c6
commit 890515edfd
9 changed files with 48 additions and 53 deletions

View File

@@ -0,0 +1,19 @@
class AddCachedLabelsList < ActiveRecord::Migration[7.0]
def change
add_column :conversations, :cached_label_list, :string
Conversation.reset_column_information
ActsAsTaggableOn::Taggable::Cache.included(Conversation)
update_exisiting_conversations
end
private
def update_exisiting_conversations
::Account.find_in_batches do |account_batch|
account_batch.each do |account|
Migration::ConversationCacheLabelJob.perform_later(account)
end
end
end
end