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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d44a186907b790e7c3841ebfa08c4d6adf15906276c85c562e18b77927198c4c
4
- data.tar.gz: e9d2e237c2980ce22783cbf9f5352824dffe2fc2ac055499e9578c30a0b237f1
3
+ metadata.gz: a9b9363247117e0981b8b7304b3ce21d62fc7edf4d5ad3e804d707c0c39ce04e
4
+ data.tar.gz: 29a8d3cead2aad95cff3823ab2c88710d97ac26be534aeaba5d3b5570d6ee4a1
5
5
  SHA512:
6
- metadata.gz: 88f2d387aeedf2c8128bc0d733d764eb5094be3c458c1ee954578647203b7cbd4907ec0159e81e05a7426674776ee0a53b2b7355523ee67be1ac1dc42d331243
7
- data.tar.gz: 5630d627210c264dd14c9b29a233631a99dfbd1fe1e49e64ffa2cfd2f0e1d71f63869153e175a437c0b07152278ed687a713f8d58e7450b6242fb4ed32a1ca17
6
+ metadata.gz: d981452366b82c427ab3a8dce44ff100c704e611a39d48e855ef2239a96d67c443d1b7b95f4c87587474a0879430a16eebe1229b89a3fdb3c4414898ed6dd01d
7
+ data.tar.gz: 1227833eea17e9202e4d82ea7f9eb36f685e5039a3f63795c35eda88e0eb18de1e0f03d576958177403f3e0e3e2e2842627313fd9362252d5a8eeace29f368f2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Workhorse Change log
2
2
 
3
+ ## 0.5.1 - 2019-06-27
4
+
5
+ * Add daemon command `kill`
6
+
3
7
  ## 0.5.0 - 2019-05-22
4
8
 
5
9
  * Added support for ActiveJob
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) and timed execution.
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.0
1
+ 0.5.1
@@ -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('TERM', pid)
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.0 ruby lib
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.0"
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-05-22"
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.0
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-05-22 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler