Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (jobs-inside-transaction): add setup for after commit everywhere and fix customer.vies_check webhook #1703

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gem 'oauth2'
gem 'rack-cors'

# Database
gem 'after_commit_everywhere'
gem 'clickhouse-activerecord', git: 'https://github.com/getlago/clickhouse-activerecord.git'
gem 'discard', '~> 1.2'
gem 'kaminari-activerecord'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
adyen-ruby-api-library (7.0.1)
faraday
after_commit_everywhere (1.4.0)
activerecord (>= 4.2)
activesupport
analytics-ruby (2.4.0)
ast (2.4.2)
aws-eventstream (1.2.0)
Expand Down Expand Up @@ -576,6 +579,7 @@ DEPENDENCIES
activejob-traceable
activejob-uniqueness
adyen-ruby-api-library
after_commit_everywhere
analytics-ruby (~> 2.4.0)
aws-sdk-s3
bcrypt
Expand Down
2 changes: 2 additions & 0 deletions app/services/base_service.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class BaseService
include AfterCommitEverywhere

class FailedResult < StandardError
attr_reader :result

Expand Down
3 changes: 1 addition & 2 deletions app/services/customers/eu_auto_taxes_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def call

def vies_check
vies_check = Valvat.new(customer.tax_identification_number).exists?(detail: true)

SendWebhookJob.perform_later('customer.vies_check', customer, vies_check:)
after_commit { SendWebhookJob.perform_later('customer.vies_check', customer, vies_check:) }

vies_check
end
Expand Down
Loading