1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

fix Stripe::RateLimitError

This commit is contained in:
Sylvain 2020-06-09 19:03:01 +02:00
parent 9ff0a06029
commit 3596e9a7a7

View File

@ -12,9 +12,9 @@ class SyncMembersOnStripeWorker
logger.debug "#{index} / #{total}"
begin
stp_customer = Stripe::Customer.retrieve member.stp_customer_id
StripeWorker.perform_async(:create_stripe_customer, member.id) if stp_customer.nil? || stp_customer[:deleted]
StripeWorker.perform(:create_stripe_customer, member.id) if stp_customer.nil? || stp_customer[:deleted]
rescue Stripe::InvalidRequestError
StripeWorker.perform_async(:create_stripe_customer, member.id)
StripeWorker.perform(:create_stripe_customer, member.id)
end
end
logger.debug 'Sync is done'