capistrano-resque-pool 0.1.0 → 0.1.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
2
  SHA1:
3
- metadata.gz: 706da99c97ea705d8c6454c551c18f78212eabed
4
- data.tar.gz: 88b38e72e580dbe67f7fb9247c64251f926e17c9
3
+ metadata.gz: 46fa0f1a9729c7c921dd1df1e205806a525abcc2
4
+ data.tar.gz: 0f22406923422aef06bee0ef405b82ec0fbf63ef
5
5
  SHA512:
6
- metadata.gz: a1b4780bfd1e5afd6a5e030b4d373ee8566d64ee1737516cab9a5952bc9bcf29d74033dda2b21b26ed9acde19ff849b163f20bf6b513c3b6908b95fd38a3ded8
7
- data.tar.gz: 2255a187f57b24ae1047f424fc3372a702095371245dbda09ed87123868b56150f8943251191203c3acc454bd78ad53060d0076225589f9ae1b7599e4be785e0
6
+ metadata.gz: 5014f793246487cba35f9c7f8d92b2454429db0ba88131842187fe88f6204442f18e0c91889c2712fe6405576bb68db01fbc56c04a0c33ad97acd3b6ea4e690a
7
+ data.tar.gz: 53001c7807b7911599d53ddba2413bdf3c3c3222650c2338e36657376ef7c03b47aef98b18f6ee6e358b930a9db20962473c286f3ce2b5ea1a4fc997073d39a2
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Capistrano integration for `resque-pool`.
4
4
 
5
+
5
6
  ## Installation
6
7
 
7
8
  Add this line to your application's Gemfile:
@@ -16,6 +17,26 @@ Or install it yourself as:
16
17
 
17
18
  $ gem install capistrano-resque-pool
18
19
 
20
+ Finally, require it in your Capfile:
21
+
22
+ require 'capistrano-resque-pool'
23
+
24
+
25
+ ## Configuration
26
+
27
+ You can setup the role or list of roles on which your run resque-pool.
28
+
29
+ ```
30
+ # config/deploy.rb
31
+ set :resque_server_roles, :worker
32
+
33
+ # config/deploy/production.rb
34
+ server 'background.example.com', roles: [:worker]
35
+ ```
36
+
37
+ By default it assumes that resque is located on servers with `app` role.
38
+
39
+
19
40
  ## Usage
20
41
 
21
42
  Start all the workers and queus.
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Resque
3
3
  module Pool
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- namespace :resque do
1
+ namespace :resque do
2
2
  namespace :pool do
3
3
  def rails_env
4
4
  fetch(:resque_rails_env) ||
@@ -14,12 +14,12 @@ namespace :resque do
14
14
  execute :bundle, :exec, 'resque-pool', "--daemon --environment #{rails_env}"
15
15
  end
16
16
  end
17
- end
17
+ end
18
18
 
19
19
  desc 'Gracefully shut down workers and shutdown the manager after all workers are done'
20
20
  task :stop do
21
21
  on roles(workers) do
22
- if pid_file_exists?
22
+ if pid_file_exists?
23
23
  pid = capture(:cat, pid_path)
24
24
  if test "kill -0 #{pid} > /dev/null 2>&1"
25
25
  execute :kill, "-s QUIT #{pid}"
@@ -44,12 +44,14 @@ namespace :resque do
44
44
 
45
45
  # Wait for the manager to stop
46
46
  on roles(workers) do
47
- info "Waiting for pool manager to stop.. "
48
- if pid_file_exists?
47
+ if pid_file_exists?
49
48
  pid = capture(:cat, pid_path)
50
49
  tries = 10
50
+
51
51
  while tries >= 0 and test("kill -0 #{pid} > /dev/null 2>&1")
52
- tries =- 1
52
+ info 'Waiting for pool manager to stop..'
53
+
54
+ tries -= 1
53
55
  sleep 5
54
56
  end
55
57
  end
@@ -61,7 +63,7 @@ namespace :resque do
61
63
  desc 'Reload the config file, reload logfiles, restart all workers'
62
64
  task :restart do
63
65
  on roles(workers) do
64
- if pid_file_exists?
66
+ if pid_file_exists?
65
67
  execute :kill, "-s HUP `cat #{pid_path}`"
66
68
  else
67
69
  invoke 'resque:pool:start'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-resque-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Abramchuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-02 00:00:00.000000000 Z
12
+ date: 2016-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.4.5.1
106
+ rubygems_version: 2.5.1
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Capistrano integration for Resque pool