workhorse 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/workhorse/daemon.rb +6 -4
- data/lib/workhorse/daemon/shell_handler.rb +5 -0
- data/workhorse.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b9363247117e0981b8b7304b3ce21d62fc7edf4d5ad3e804d707c0c39ce04e
|
4
|
+
data.tar.gz: 29a8d3cead2aad95cff3823ab2c88710d97ac26be534aeaba5d3b5570d6ee4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d981452366b82c427ab3a8dce44ff100c704e611a39d48e855ef2239a96d67c443d1b7b95f4c87587474a0879430a16eebe1229b89a3fdb3c4414898ed6dd01d
|
7
|
+
data.tar.gz: 1227833eea17e9202e4d82ea7f9eb36f685e5039a3f63795c35eda88e0eb18de1e0f03d576958177403f3e0e3e2e2842627313fd9362252d5a8eeace29f368f2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,7 @@ What it does not do:
|
|
27
27
|
but not in separate processes (unless you manually start multiple worker
|
28
28
|
processes).
|
29
29
|
* It does not support
|
30
|
-
[timeouts](FAQ.md#why-does-workhorse-not-support-timeouts)
|
30
|
+
[timeouts](FAQ.md#why-does-workhorse-not-support-timeouts).
|
31
31
|
|
32
32
|
## Installation
|
33
33
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/lib/workhorse/daemon.rb
CHANGED
@@ -41,7 +41,7 @@ module Workhorse
|
|
41
41
|
return code
|
42
42
|
end
|
43
43
|
|
44
|
-
def stop
|
44
|
+
def stop(kill = false)
|
45
45
|
code = 0
|
46
46
|
|
47
47
|
for_each_worker do |worker_id|
|
@@ -49,7 +49,7 @@ module Workhorse
|
|
49
49
|
|
50
50
|
if pid_file && pid
|
51
51
|
puts "Worker ##{worker_id}: Stopping"
|
52
|
-
stop_worker pid_file, pid
|
52
|
+
stop_worker pid_file, pid, kill
|
53
53
|
elsif pid_file
|
54
54
|
File.delete pid_file
|
55
55
|
puts "Worker ##{worker_id}: Already stopped (stale PID file)"
|
@@ -115,10 +115,12 @@ module Workhorse
|
|
115
115
|
IO.write(pid_file_for(worker_id), pid)
|
116
116
|
end
|
117
117
|
|
118
|
-
def stop_worker(pid_file, pid)
|
118
|
+
def stop_worker(pid_file, pid, kill = false)
|
119
|
+
signal = kill ? 'KILL' : 'TERM'
|
120
|
+
|
119
121
|
loop do
|
120
122
|
begin
|
121
|
-
Process.kill(
|
123
|
+
Process.kill(signal, pid)
|
122
124
|
rescue Errno::ESRCH
|
123
125
|
break
|
124
126
|
end
|
@@ -18,6 +18,8 @@ module Workhorse
|
|
18
18
|
exit daemon.start
|
19
19
|
when 'stop'
|
20
20
|
exit daemon.stop
|
21
|
+
when 'kill'
|
22
|
+
exit daemon.stop(true)
|
21
23
|
when 'status'
|
22
24
|
exit daemon.status
|
23
25
|
when 'watch'
|
@@ -52,6 +54,9 @@ Options:
|
|
52
54
|
stop
|
53
55
|
Stop the daemon
|
54
56
|
|
57
|
+
kill
|
58
|
+
Kill the daemon
|
59
|
+
|
55
60
|
status
|
56
61
|
Query the status of the daemon. Exit with status 1 if any worker is
|
57
62
|
not running.
|
data/workhorse.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: workhorse 0.5.
|
2
|
+
# stub: workhorse 0.5.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "workhorse".freeze
|
6
|
-
s.version = "0.5.
|
6
|
+
s.version = "0.5.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Sitrox".freeze]
|
11
|
-
s.date = "2019-
|
11
|
+
s.date = "2019-06-27"
|
12
12
|
s.files = [".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".travis.yml".freeze, "CHANGELOG.md".freeze, "FAQ.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "RUBY_VERSION".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/rubocop".freeze, "lib/active_job/queue_adapters/workhorse_adapter.rb".freeze, "lib/generators/workhorse/install_generator.rb".freeze, "lib/generators/workhorse/templates/bin/workhorse.rb".freeze, "lib/generators/workhorse/templates/config/initializers/workhorse.rb".freeze, "lib/generators/workhorse/templates/create_table_jobs.rb".freeze, "lib/workhorse.rb".freeze, "lib/workhorse/daemon.rb".freeze, "lib/workhorse/daemon/shell_handler.rb".freeze, "lib/workhorse/db_job.rb".freeze, "lib/workhorse/enqueuer.rb".freeze, "lib/workhorse/jobs/cleanup_succeeded_jobs.rb".freeze, "lib/workhorse/jobs/run_active_job.rb".freeze, "lib/workhorse/jobs/run_rails_op.rb".freeze, "lib/workhorse/performer.rb".freeze, "lib/workhorse/poller.rb".freeze, "lib/workhorse/pool.rb".freeze, "lib/workhorse/worker.rb".freeze, "test/active_job/queue_adapters/workhorse_adapter_test.rb".freeze, "test/lib/db_schema.rb".freeze, "test/lib/jobs.rb".freeze, "test/lib/test_helper.rb".freeze, "test/workhorse/db_job_test.rb".freeze, "test/workhorse/enqueuer_test.rb".freeze, "test/workhorse/performer_test.rb".freeze, "test/workhorse/poller_test.rb".freeze, "test/workhorse/pool_test.rb".freeze, "test/workhorse/worker_test.rb".freeze, "workhorse.gemspec".freeze]
|
13
13
|
s.rubygems_version = "3.0.3".freeze
|
14
14
|
s.summary = "Multi-threaded job backend with database queuing for ruby.".freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workhorse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sitrox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|