sidekiq-runner 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sidekiq-runner/version.rb +1 -1
- data/lib/sidekiq-runner.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa1f4476684b0f716b49b69ab7f9bafb1cae76d
|
4
|
+
data.tar.gz: c7a620e97fcef970a8e4d12a41cdc07999a149e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50414396e78b69576b4f00a90bb6ec63f2b8a4c7167b4faa60b453f1d05b8fd2ef8a09d7e7924c37ddc28c44e31f78dbffcc4b8b820fa4bd58c3719768b7c0a
|
7
|
+
data.tar.gz: 3d267f736c3109b0fd77e22db03cd871e6e5d5262107cd1f045e2b22381497f628720d22599d37404f7c86eb9ab9dd04c9a83912622966025df78218d0541cf4
|
data/lib/sidekiq-runner.rb
CHANGED
@@ -18,9 +18,14 @@ module SidekiqRunner
|
|
18
18
|
abort 'God is already running.' if god_alive?(god_config)
|
19
19
|
|
20
20
|
run(:start, sidekiq_config) do
|
21
|
+
$0 = "SidekiqRunner/God (#{god_config.process_name})"
|
22
|
+
|
21
23
|
puts 'Starting god.'
|
22
24
|
God::CLI::Run.new(god_config.options)
|
23
25
|
end
|
26
|
+
|
27
|
+
sleep 1
|
28
|
+
fail 'Failed to start God.' unless god_alive?(god_config)
|
24
29
|
end
|
25
30
|
|
26
31
|
def self.stop
|
@@ -30,12 +35,12 @@ module SidekiqRunner
|
|
30
35
|
God::EventHandler.load
|
31
36
|
|
32
37
|
if god_alive?(god_config)
|
38
|
+
puts "Terminating god process #{god_config.process_name}..."
|
39
|
+
|
33
40
|
sidekiq_config.each_key do |name|
|
34
|
-
puts "Stopping Sidekiq instance #{name}..."
|
35
41
|
God::CLI::Command.new('stop', god_config.options, ['', name])
|
36
42
|
end
|
37
43
|
|
38
|
-
puts "Terminating god process #{god_config.process_name}..."
|
39
44
|
God::CLI::Command.new('terminate', god_config.options, [])
|
40
45
|
else
|
41
46
|
abort 'God is not running, so no need to stop it.'
|
@@ -46,8 +51,6 @@ module SidekiqRunner
|
|
46
51
|
private
|
47
52
|
|
48
53
|
def self.god_alive?(god_config)
|
49
|
-
puts 'Checking whether god is alive...'
|
50
|
-
|
51
54
|
require 'drb'
|
52
55
|
require 'god/socket'
|
53
56
|
DRb.start_service('druby://127.0.0.1:0')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FlavourSys Technology GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|