Files
leadchat/app/jobs/migration/conversation_cache_label_job.rb
Pranav Raj S 00eb5b152a chore(migration): Re-run database migration job for caching. (#8581)
A support request that came to Chatwoot Cloud revealed that the job was timed prematurely. The default timeout for Sidekiq queues was set as 25 minutes in sidekiq.yml file. The cache was not created properly for the accounts with more than 100k conversations.

This change removes the cache logic in the previous migration and creates a new migration with a new job which processes conversations in batch.
2023-12-18 17:29:02 -08:00

10 lines
304 B
Ruby

class Migration::ConversationCacheLabelJob < ApplicationJob
queue_as :async_database_migration
def perform(account)
account.conversations.find_in_batches(batch_size: 100) do |conversation_batch|
Migration::ConversationBatchCacheLabelJob.perform_later(conversation_batch)
end
end
end