eivo-rails-sidekiq 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 18e1a43a717d80f54d5c82776f4ae1f932a2ed47
4
- data.tar.gz: 2f6bcf3d020e84b990f8990aece2a88911d7ca36
2
+ SHA256:
3
+ metadata.gz: e9c5a8a7c8b98d2919617c975143a26fde52dd2c4d6eac0ffb5bdc8fa34d9e8f
4
+ data.tar.gz: 0207c17f23e5a8c01045a0e458dc67fad739821516ca58bd09cafc61098becc3
5
5
  SHA512:
6
- metadata.gz: 8e9e9cd29a80a0621e738ce519642b48718ac97c34719fdff71d93a5cf39254aff3a9ac44fc3fc31b4a16eb2957a936ace79bc76e2637c460c17d4586763cb57
7
- data.tar.gz: 499772a50621222749c643f4e5f9a9c3ca7aa57c542390f92c4851e8c971f9eb5a9c97215846d9bde86b21c2969392dbeff673b521d7537a289aaae8cb546689
6
+ metadata.gz: 8e54da8308c0bcfa826dba5bec0c195e524f001951add869ad224b0c585177c731ebb06259c1909f2341a2bc590db6d55f6b35e89e3a6b562c192cd9561f6b34
7
+ data.tar.gz: 76cb6044d5779166e38adef5f16c6a423cc511feff6e926ff94a7ec65d5a1f1f6f4fb4158817348942ee3b5e77ec17e8896d78a62ba27a863b67cb1a66f524c3
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'sidekiq'
4
- require 'redis-namespace'
5
4
  require 'hiredis'
6
5
 
7
6
  redis_config = {
8
7
  url: ENV.fetch('REDIS_URL') { 'redis://localhost:6379/0' },
9
- namespace: "#{Rails.application.class.parent_name.parameterize}-#{Rails.env}",
10
8
  driver: 'hiredis'
11
9
  }
12
10
 
@@ -16,6 +14,7 @@ end
16
14
 
17
15
  Sidekiq.configure_server do |config|
18
16
  config.redis = redis_config.dup
17
+ config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
19
18
  end
20
19
 
21
20
  ActiveJob::Base.queue_adapter = :sidekiq if defined?(ActiveJob)
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'eivo-rails-sidekiq'
5
- spec.version = '0.0.2'
5
+ spec.version = '0.1.0'
6
6
  spec.authors = ['Jonathan VUKOVICH-TRIBOUHARET']
7
7
  spec.email = ['jonathan@eivo.co']
8
8
 
@@ -16,8 +16,7 @@ Gem::Specification.new do |spec|
16
16
  end
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_dependency 'sidekiq', '< 6'
20
- spec.add_dependency 'redis-namespace'
19
+ spec.add_dependency 'sidekiq', '>= 6', '< 7'
21
20
  spec.add_dependency 'hiredis'
22
21
 
23
22
  spec.add_development_dependency 'bundler'
@@ -15,41 +15,7 @@ module EIVO
15
15
  def create_initializer_file
16
16
  copy_file 'config/sidekiq.yml'
17
17
  copy_file 'app/jobs/application_job.rb'
18
-
19
- restart_code = <<-'EOF'
20
- ### EIVO Sidekiq begin ###
21
-
22
- bundle exec sidekiqctl stop tmp/pids/sidekiq.pid 120
23
- bundle exec sidekiq -C config/sidekiq.yml
24
-
25
- ### EIVO Sidekiq end ###
26
- EOF
27
-
28
- stop_code = <<-'EOF'
29
- ### EIVO Sidekiq begin ###
30
-
31
- bundle exec sidekiqctl stop tmp/pids/sidekiq.pid 15
32
-
33
- ### EIVO Sidekiq end ###
34
- EOF
35
-
36
- # Remove old code if present
37
- regexp = /\n### EIVO Sidekiq begin ###.*### EIVO Sidekiq end ###/m
38
- gsub_file 'restart_production.sh', regexp, ''
39
- gsub_file 'restart_staging.sh', regexp, ''
40
- gsub_file 'stop_production.sh', regexp, ''
41
- gsub_file 'stop_staging.sh', regexp, ''
42
-
43
- # Inject new code
44
- after = "### EIVO end ###\n"
45
- inject_into_file 'restart_production.sh', restart_code, after: after
46
- inject_into_file 'restart_staging.sh', restart_code, after: after
47
- inject_into_file 'stop_production.sh', stop_code, after: after
48
- inject_into_file 'stop_staging.sh', stop_code, after: after
49
-
50
18
  append_to_file 'Procfile', "worker: bundle exec sidekiq -C config/sidekiq.yml\n"
51
- append_to_file '.env.example', "SIDEKIQ_THREADS=\"5\"\n"
52
- gsub_file '.env.example', /^DB_POOL="(\d+)".*/, 'DB_POOL="\1" # [RAILS_MAX_THREADS, SIDEKIQ_THREADS].max'
53
19
  end
54
20
 
55
21
  end
@@ -1,11 +1,3 @@
1
1
  :concurrency: <%= ENV.fetch('SIDEKIQ_THREADS') { 5 } %>
2
- staging:
3
- :daemon: true
4
- :pidfile: tmp/pids/sidekiq-staging.pid
5
- :logfile: log/sidekiq-staging.log
6
- production:
7
- :daemon: true
8
- :pidfile: tmp/pids/sidekiq.pid
9
- :logfile: log/sidekiq.log
10
2
  :queues:
11
3
  - default
metadata CHANGED
@@ -1,43 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eivo-rails-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan VUKOVICH-TRIBOUHARET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2020-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
20
  - - "<"
25
21
  - !ruby/object:Gem::Version
26
- version: '6'
27
- - !ruby/object:Gem::Dependency
28
- name: redis-namespace
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
22
+ version: '7'
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
27
  - - ">="
39
28
  - !ruby/object:Gem::Version
40
- version: '0'
29
+ version: '6'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '7'
41
33
  - !ruby/object:Gem::Dependency
42
34
  name: hiredis
43
35
  requirement: !ruby/object:Gem::Requirement
@@ -119,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
111
  - !ruby/object:Gem::Version
120
112
  version: '0'
121
113
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.4.5
114
+ rubygems_version: 3.1.2
124
115
  signing_key:
125
116
  specification_version: 4
126
117
  summary: EIVO Rails Sidekiq