Files
chatwoot/app/models
Vishnu Narayanan c10d39f42e fix: Optimize message reindexing to reduce sidekiq job creation
Changes searchkick callback behavior to check `should_index?` before
  creating reindex jobs, preventing unnecessary job creation for messages
  that don't need indexing (activity messages, unpaid accounts, etc.).

  Previously, `callbacks: :async` created reindex jobs for all messages
  (~5,100/min or 7.3M/day in production), which were then filtered by
  `should_index?` inside the job worker - resulting in 98% wasted jobs
  , Redis memory pressure and avoidable p0 alerts.

  Now, `should_index?` is checked before job creation via  `after_commit`
  callback, reducing job creation to actual incoming/outgoing
  messages from paid accounts.

  Changes:
  - Disable automatic searchkick callbacks
  - Add manual `after_commit` callback with `should_index?` condition
  - Add specs to verify callback behavior

  Expected impact:
  - 98% reduction in sidekiq job creation (~7.3M → ~150K jobs/day)
  - Reduced redis memory usage
  - Same async indexing behavior for eligible messages
2025-10-08 16:26:46 +05:30
..
2025-07-16 09:04:02 +05:30
2022-05-16 13:59:59 +05:30
2020-09-26 02:32:34 +05:30
2025-09-18 20:19:24 +05:30
2025-09-18 20:19:24 +05:30