sidekiq-pool 1.7.1 → 1.8.1

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: 7a162dd3ea8ea76a7cf305fbff7d91c0f99e61a5
4
- data.tar.gz: 3a78db0121e97e963b040609e7a7885d57dc460f
2
+ SHA256:
3
+ metadata.gz: ca3fa913c595d916c0df9e2897c6047fae80eef1f78e3a7e53779874c9e3ade9
4
+ data.tar.gz: 20d365396e1a193714f91a8c80dc625e29e1d309acd66ce9f6b53de38e603619
5
5
  SHA512:
6
- metadata.gz: 313c847ff56222ed271b37274ce7339ff2778f38742017fecd8a32a15065aa052c7fe42d0f01008be82342d6ee77f9e2ce10136e234f460cf680a17f371627a7
7
- data.tar.gz: 77c2f57d9294ccedd64bcd2a8ba032e5ad1d259219f3603e9f475b59a672d4877538a71c160dea4b246e4c1442097e991c9b89122a5aef6b4a2f7853ba66ece3
6
+ metadata.gz: 8138fb77f6ca5e6601955f513ad5a0d0ed2953f87f1e1179aa575fc7e8d6d43fb5b995497d34babf70e6c3be168cef5c59cc3c289abeb55a4cd0ae1676790c41
7
+ data.tar.gz: 054f960402c6888ede263ab667389fc3bbaf0d1352b3acf7f040b0d6bb57f18f251de2d4ac99207fc48bdad42a45ac204f12fb4dc906457014f4527723ffb91b
@@ -0,0 +1,54 @@
1
+ name: Build and release ruby gem
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ master ]
6
+ push:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build-release-pipeline:
11
+ runs-on: ubuntu-latest
12
+ container: ruby:2.7.2
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Setup
16
+ run: |
17
+ apt-get update -y && apt-get install -y --no-install-recommends cmake=3.13.4-1
18
+ gem install bundler
19
+ bundle install
20
+
21
+ - name: Test
22
+ run: bundle exec rake
23
+
24
+ - name: Build
25
+ id: build
26
+ if: success() && github.ref == 'refs/heads/master'
27
+ run: |
28
+ bundle exec rake build
29
+ echo "::set-output name=gem_version::v$(bundle exec rake version)"
30
+
31
+ - name: Release
32
+ if: success() && github.ref == 'refs/heads/master'
33
+ run: |
34
+ mkdir -p $HOME/.gem
35
+ touch $HOME/.gem/credentials
36
+ chmod 600 $HOME/.gem/credentials
37
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
38
+ gem push pkg/*
39
+ env:
40
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
41
+
42
+ - name: Tag repo with new gem version
43
+ if: success() && github.ref == 'refs/heads/master'
44
+ uses: actions/github-script@v3
45
+ with:
46
+ github-token: ${{ github.token }}
47
+ script: |
48
+ github.git.createRef({
49
+ owner: context.repo.owner,
50
+ repo: context.repo.repo,
51
+ ref: "refs/tags/${{ steps.build.outputs.gem_version }}",
52
+ sha: context.sha
53
+ })
54
+
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ .idea/
data/.rubocop.yml ADDED
@@ -0,0 +1,15 @@
1
+ LineLength:
2
+ Max: 99
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.5
6
+
7
+ Documentation:
8
+ Enabled: false
9
+
10
+ Style/TrailingCommaInHashLiteral:
11
+ EnforcedStyleForMultiline: comma
12
+
13
+ Metrics/BlockLength:
14
+ Exclude:
15
+ - spec/**/*.rb
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Sidekiq::Pool
2
2
 
3
3
  [![Gem](https://img.shields.io/gem/v/sidekiq-pool.svg)](https://rubygems.org/gems/sidekiq-pool)
4
- [![Build Status](https://travis-ci.org/laurynas/sidekiq-pool.svg?branch=master)](https://travis-ci.org/laurynas/sidekiq-pool)
4
+ [![Build Status](https://travis-ci.org/vinted/sidekiq-pool.svg?branch=master)](https://travis-ci.org/vinted/sidekiq-pool)
5
5
 
6
6
  Allows Sidekiq using more CPU cores on Ruby MRI by forking multiple processes.
7
7
  Also adds an option to use different command line option workers in the same pool.
@@ -41,7 +41,7 @@ Start pool with a non-default path config
41
41
 
42
42
  ## Signals
43
43
 
44
- Signals `USR1`, `USR2` are forwarded to the children.
44
+ Signals `USR1`, `USR2`, and `TSTP` are forwarded to the children. Depending on the version of Sidekiq, you may need to send `USR1` or `TSTP` to prepare it for shutdown. For more information, please read [signals and sidekiq](https://github.com/mperham/sidekiq/wiki/Signals) documentation.
45
45
 
46
46
  Signal `HUP` to parent starts new children and then stops old.
47
47
 
@@ -60,7 +60,7 @@ end
60
60
 
61
61
  ## Contributing
62
62
 
63
- Bug reports and pull requests are welcome on GitHub at https://github.com/laurynas/sidekiq-pool.
63
+ Bug reports and pull requests are welcome on GitHub at https://github.com/vinted/sidekiq-pool.
64
64
 
65
65
  ## License
66
66
 
data/Rakefile CHANGED
@@ -4,3 +4,7 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ task :version do |t|
9
+ puts Sidekiq::Pool::VERSION
10
+ end
data/lib/sidekiq/pool.rb CHANGED
@@ -5,12 +5,11 @@ module Sidekiq
5
5
  module_function
6
6
 
7
7
  def after_fork(&block)
8
- @after_fork_hooks ||= []
9
- @after_fork_hooks << block
8
+ after_fork_hooks << block
10
9
  end
11
10
 
12
11
  def after_fork_hooks
13
- @after_fork_hooks
12
+ @after_fork_hooks ||= []
14
13
  end
15
14
  end
16
15
  end
@@ -1,5 +1,5 @@
1
1
  require 'sidekiq/cli'
2
- require 'sidekiq/pool/version'
2
+ require 'sidekiq/pool'
3
3
 
4
4
  module Sidekiq
5
5
  module Pool
@@ -178,7 +178,7 @@ module Sidekiq
178
178
  def trap_signals
179
179
  @self_read, @self_write = IO.pipe
180
180
 
181
- %w(INT TERM USR1 USR2 CHLD HUP).each do |sig|
181
+ %w(INT TERM USR1 TSTP USR2 CHLD HUP).each do |sig|
182
182
  begin
183
183
  trap sig do
184
184
  @self_write.puts(sig) unless fork?
@@ -241,7 +241,7 @@ module Sidekiq
241
241
  exit(0)
242
242
  when 'CHLD'
243
243
  check_pool
244
- when 'USR1'
244
+ when 'USR1', 'TSTP'
245
245
  @done = true
246
246
  update_process_name
247
247
  signal_to_pool(sig)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Pool
3
- VERSION = '1.7.1'
3
+ VERSION = '1.8.1'
4
4
  end
5
5
  end
data/sidekiq-pool.gemspec CHANGED
@@ -6,21 +6,22 @@ require 'sidekiq/pool/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'sidekiq-pool'
8
8
  spec.version = Sidekiq::Pool::VERSION
9
- spec.authors = ['Laurynas Butkus', 'Raimondas Valickas']
10
- spec.email = ['laurynas.butkus@gmail.com', 'raimondas.valickas@gmail.com']
9
+ spec.authors = ['Vinted']
10
+ spec.email = ['backend@vinted.com']
11
11
 
12
12
  spec.summary = %q{Forks and manages multiple Sidekiq processes}
13
13
  spec.description = %q{Allows Sidekiq using more CPU cores on Ruby MRI by forking multiple processes.}
14
- spec.homepage = 'https://github.com/laurynas/sidekiq-pool'
14
+ spec.homepage = 'https://github.com/vinted/sidekiq-pool'
15
15
  spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.executables = ['sidekiq-pool']
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'sidekiq', '>= 3.0', '< 6.0'
21
+ spec.add_dependency 'sidekiq', '>= 3.0', '< 7.0'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.11'
24
- spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'bundler'
24
+ spec.add_development_dependency 'pronto-rubocop', '~> 0.10'
25
+ spec.add_development_dependency 'rake', '~> 13.0'
25
26
  spec.add_development_dependency 'rspec', '~> 3.0'
26
27
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
- - Laurynas Butkus
8
- - Raimondas Valickas
7
+ - Vinted
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2021-04-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sidekiq
@@ -20,7 +19,7 @@ dependencies:
20
19
  version: '3.0'
21
20
  - - "<"
22
21
  - !ruby/object:Gem::Version
23
- version: '6.0'
22
+ version: '7.0'
24
23
  type: :runtime
25
24
  prerelease: false
26
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,35 +29,49 @@ dependencies:
30
29
  version: '3.0'
31
30
  - - "<"
32
31
  - !ruby/object:Gem::Version
33
- version: '6.0'
32
+ version: '7.0'
34
33
  - !ruby/object:Gem::Dependency
35
34
  name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: pronto-rubocop
36
49
  requirement: !ruby/object:Gem::Requirement
37
50
  requirements:
38
51
  - - "~>"
39
52
  - !ruby/object:Gem::Version
40
- version: '1.11'
53
+ version: '0.10'
41
54
  type: :development
42
55
  prerelease: false
43
56
  version_requirements: !ruby/object:Gem::Requirement
44
57
  requirements:
45
58
  - - "~>"
46
59
  - !ruby/object:Gem::Version
47
- version: '1.11'
60
+ version: '0.10'
48
61
  - !ruby/object:Gem::Dependency
49
62
  name: rake
50
63
  requirement: !ruby/object:Gem::Requirement
51
64
  requirements:
52
65
  - - "~>"
53
66
  - !ruby/object:Gem::Version
54
- version: '10.0'
67
+ version: '13.0'
55
68
  type: :development
56
69
  prerelease: false
57
70
  version_requirements: !ruby/object:Gem::Requirement
58
71
  requirements:
59
72
  - - "~>"
60
73
  - !ruby/object:Gem::Version
61
- version: '10.0'
74
+ version: '13.0'
62
75
  - !ruby/object:Gem::Dependency
63
76
  name: rspec
64
77
  requirement: !ruby/object:Gem::Requirement
@@ -75,16 +88,16 @@ dependencies:
75
88
  version: '3.0'
76
89
  description: Allows Sidekiq using more CPU cores on Ruby MRI by forking multiple processes.
77
90
  email:
78
- - laurynas.butkus@gmail.com
79
- - raimondas.valickas@gmail.com
91
+ - backend@vinted.com
80
92
  executables:
81
93
  - sidekiq-pool
82
94
  extensions: []
83
95
  extra_rdoc_files: []
84
96
  files:
97
+ - ".github/workflows/build_release_pipeline.yaml"
85
98
  - ".gitignore"
86
99
  - ".rspec"
87
- - ".travis.yml"
100
+ - ".rubocop.yml"
88
101
  - Gemfile
89
102
  - LICENSE.txt
90
103
  - README.md
@@ -95,7 +108,7 @@ files:
95
108
  - lib/sidekiq/pool/cli.rb
96
109
  - lib/sidekiq/pool/version.rb
97
110
  - sidekiq-pool.gemspec
98
- homepage: https://github.com/laurynas/sidekiq-pool
111
+ homepage: https://github.com/vinted/sidekiq-pool
99
112
  licenses:
100
113
  - MIT
101
114
  metadata: {}
@@ -114,8 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
127
  - !ruby/object:Gem::Version
115
128
  version: '0'
116
129
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.6.11
130
+ rubygems_version: 3.1.4
119
131
  signing_key:
120
132
  specification_version: 4
121
133
  summary: Forks and manages multiple Sidekiq processes
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.1
4
- - 2.4.1
5
- - 2.3.4
6
- - 2.2.7
7
- before_install: gem install bundler -v 1.11.2