chore: Ensure template_sync timestamp is updated (#7265)

Fix for the cases where there are multiple channels with invalid provider config, which results in the templates sync scheduler failing to schedule jobs for valid channels.

fixes: https://linear.app/chatwoot/issue/CW-2032/bug-whatsapp-template-sync-failing-in-cloud
This commit is contained in:
Sojan Jose
2023-06-07 17:18:24 +05:30
committed by GitHub
parent 39eaed7766
commit 7e89e3a34a
3 changed files with 12 additions and 4 deletions

View File

@@ -50,6 +50,12 @@ class Channel::Whatsapp < ApplicationRecord
true
end
def mark_message_templates_updated
# rubocop:disable Rails/SkipsModelValidations
update_column(:message_templates_last_updated, Time.zone.now)
# rubocop:enable Rails/SkipsModelValidations
end
delegate :send_message, to: :provider_service
delegate :send_template, to: :provider_service
delegate :sync_templates, to: :provider_service