feat: add job to remove stale contacts and contact_inboxes (#11186)

- Add a job to remove stale contacts and contact_inboxes across all accounts

Stale anonymous contact is defined as 
- have no identification (email, phone_number, and identifier are NULL)
- have no conversations
- are older than 30 days

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
Vishnu Narayanan
2025-03-28 12:18:39 +05:30
committed by GitHub
parent 001b25c92a
commit 0175714d65
8 changed files with 164 additions and 0 deletions

View File

@@ -32,3 +32,10 @@ remove_stale_redis_keys_job.rb:
cron: '30 22 * * *'
class: 'Internal::RemoveStaleRedisKeysJob'
queue: scheduled_jobs
# executed daily at 2230 UTC
# which is our lowest traffic time
# process_stale_contacts_job:
# cron: '30 22 * * *'
# class: 'Internal::ProcessStaleContactsJob'
# queue: scheduled_jobs