fix: Do not enqueue job if it is already enqueued (#5068)

This commit is contained in:
Pranav Raj S
2022-07-19 21:12:31 +05:30
committed by GitHub
parent 7fc0d166e8
commit cd5e0c548c
2 changed files with 15 additions and 1 deletions

View File

@@ -3,7 +3,10 @@ class Enterprise::Api::V1::AccountsController < Api::BaseController
before_action :check_authorization
def subscription
Enterprise::CreateStripeCustomerJob.perform_later(@account) if stripe_customer_id.blank?
if stripe_customer_id.blank? && @account.custom_attributes['is_creating_customer'].blank?
@account.update(custom_attributes: { is_creating_customer: true })
Enterprise::CreateStripeCustomerJob.perform_later(@account)
end
head :no_content
end