Skip to content

Commit

Permalink
feat: add background job related gems
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Nov 29, 2019
1 parent e6484c9 commit 5360c91
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
14 changes: 10 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ gem "ckb-sdk-ruby", git: "https://github.com/nervosnetwork/ckb-sdk-ruby.git", re
gem "hiredis", "~> 0.6.1"
gem "redis", "~> 4.0", ">= 4.0.3"

# Sidekiq
gem "sidekiq", "~> 5.2", ">= 5.2.3"
gem "sidekiq-unique-jobs"
gem "sidekiq-failures"
# Backgroud Jobs

group :production, :staging, :development do
gem "sidekiq"
gem "sidekiq-statistic"
gem "sidekiq-cron"
gem "sidekiq-unique-jobs"
gem "sidekiq-status"
gem "sidekiq-failures"
end

# bulk insertion of data into database using ActiveRecord
gem "activerecord-import"
Expand Down
23 changes: 22 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ GEM
bootsnap (1.4.4)
msgpack (~> 1.0)
builder (3.2.3)
chronic_duration (0.10.6)
numerizer (~> 0.1.1)
codecov (0.1.14)
json
simplecov
Expand Down Expand Up @@ -146,6 +148,8 @@ GEM
dry-types (~> 0.14.0)
equatable (0.5.0)
erubi (1.8.0)
et-orbi (1.2.2)
tzinfo
factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.2)
Expand All @@ -154,6 +158,9 @@ GEM
fast_jsonapi (1.5)
activesupport (>= 4.2)
ffi (1.11.2)
fugit (1.3.3)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
hashdiff (0.4.0)
Expand Down Expand Up @@ -210,6 +217,7 @@ GEM
nio4r (2.4.0)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
numerizer (0.1.1)
open4 (1.3.4)
parallel (1.17.0)
parser (2.6.3.0)
Expand All @@ -226,6 +234,7 @@ GEM
public_suffix (3.1.0)
puma (4.1.1)
nio4r (~> 2.0)
raabro (1.1.6)
rack (2.0.7)
rack-accept (0.4.5)
rack (>= 0.4)
Expand Down Expand Up @@ -292,8 +301,17 @@ GEM
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
sidekiq-cron (1.1.0)
fugit (~> 1.1)
sidekiq (>= 4.2.1)
sidekiq-failures (1.0.0)
sidekiq (>= 4.0.0)
sidekiq-statistic (1.4.0)
sidekiq (>= 5.0)
tilt (~> 2.0)
sidekiq-status (1.1.4)
chronic_duration
sidekiq (>= 3.0)
sidekiq-unique-jobs (6.0.13)
concurrent-ruby (~> 1.0, >= 1.0.5)
sidekiq (>= 4.0, < 7.0)
Expand Down Expand Up @@ -389,8 +407,11 @@ DEPENDENCIES
ruby-progressbar
shoulda-context
shoulda-matchers
sidekiq (~> 5.2, >= 5.2.3)
sidekiq
sidekiq-cron
sidekiq-failures
sidekiq-statistic
sidekiq-status
sidekiq-unique-jobs
simplecov
spring
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
require "sidekiq/web"
require "sidekiq_unique_jobs/web"
require "sidekiq/cron/web"
mount Sidekiq::Web => "/sidekiq"

root "application#homepage"
Expand Down
11 changes: 4 additions & 7 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
:concurrency: 5
:queues:
- [inauthentic_sync, 4]
- [tx_fee_updater, 4]
- [block_reward_updater, 4]
- [authentic_sync, 3]
- [transaction_status_updater, 3]
- critical
- default
- low

production:
:concurrency: 40
:concurrency: 10
staging:
:concurrency: 15
:concurrency: 10

0 comments on commit 5360c91

Please sign in to comment.