feat(perf): Cache labels on the conversation model (#8527)
This commit is contained in:
19
db/migrate/20231211010807_add_cached_labels_list.rb
Normal file
19
db/migrate/20231211010807_add_cached_labels_list.rb
Normal 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
|
||||
Reference in New Issue
Block a user