Skip to content

Commit

Permalink
Make Sidekiq transaction-aware to optimise posting runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorbg committed Dec 2, 2023
1 parent 6949d9a commit 96bfa65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions WcaOnRails/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ gem 'sprockets-rails'
gem 'fuzzy-string-match'
gem 'sidekiq'
gem 'sidekiq-cron'
gem 'after_commit_everywhere'

group :development, :test do
gem 'spring'
Expand Down
4 changes: 4 additions & 0 deletions WcaOnRails/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
after_commit_everywhere (1.3.1)
activerecord (>= 4.2)
activesupport
ansi (1.5.0)
api-pagination (5.0.0)
ast (2.4.2)
Expand Down Expand Up @@ -768,6 +771,7 @@ PLATFORMS
DEPENDENCIES
activerecord-import
activestorage-validator
after_commit_everywhere
api-pagination
apparition!
aws-sdk-cloudfront
Expand Down
3 changes: 3 additions & 0 deletions WcaOnRails/config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
Sidekiq.configure_client do |config|
config.redis = { url: EnvConfig.SIDEKIQ_REDIS_URL }
end

# Make sure that job inserts during transaction are only inserted when the transaction completes.
Sidekiq.transactional_push!

0 comments on commit 96bfa65

Please sign in to comment.