fix(app-store): keep sync cursor on review failures

This commit is contained in:
Muhsin
2026-06-03 13:40:14 +04:00
parent 0cdcf30c39
commit 4e9abd6f08
3 changed files with 18 additions and 1 deletions
@@ -4,12 +4,16 @@ class Inboxes::FetchAppStoreReviewsJob < ApplicationJob
def perform(channel)
return unless channel.account.feature_enabled?(:channel_app_store)
failed = false
channel.fetch_reviews.each do |review_payload|
::AppStore::ReviewBuilder.new(review_payload: review_payload, channel: channel).perform
rescue StandardError => e
failed = true
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception
end
return if failed
channel.update!(last_synced_at: Time.current)
rescue StandardError => e
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception