workhorse 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +4 -0
- data/VERSION +1 -1
- data/lib/workhorse.rb +11 -0
- data/lib/workhorse/daemon.rb +5 -5
- data/lib/workhorse/poller.rb +1 -1
- 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: 70ec4e9fcd51e3f833f4a1f5c340cb64510b2d564fb6f8f17ef090e530ce56e4
|
4
|
+
data.tar.gz: d0cee1476443206bd7f061e28addaf069489aa2a213e0a24eb36ad8d9e666eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 802f9ffea56e792143fc0665280f29f127f2b5b71fef9fc39fe1b2f3cf8e119c6785d5ddca7823437c8c17afd83100a8ec43566ccee51369869c922000640d10
|
7
|
+
data.tar.gz: a0582c12be5b28ab9c36c64c78dce264763e6e423fa3d91dbd18c2385f0681876c81e0fb10d887baf1aaa0a7912cbf97add79555e339631ce82857a15af71516
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Workhorse Changelog
|
2
2
|
|
3
|
+
## 1.0.0.beta2 - 2020-08-27
|
4
|
+
|
5
|
+
* Add option `config.silence_poller_exceptions` (default `false`)
|
6
|
+
|
7
|
+
* Add option `config.silence_watcher` (default `false`)
|
8
|
+
|
3
9
|
## 1.0.0.beta1 - 2020-08-20
|
4
10
|
|
5
11
|
This is a stability release that is still experimental and has to be tested in
|
data/README.md
CHANGED
@@ -290,6 +290,10 @@ Workhorse.setup do |config|
|
|
290
290
|
end
|
291
291
|
```
|
292
292
|
|
293
|
+
Using the settings `config.silence_poller_exceptions` and
|
294
|
+
`config.silence_watcher`, you can silence certain exceptions / error outputs
|
295
|
+
(both are disabled by default).
|
296
|
+
|
293
297
|
## Handling database jobs
|
294
298
|
|
295
299
|
Jobs stored in the database can be accessed via the ActiveRecord model
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta2
|
data/lib/workhorse.rb
CHANGED
@@ -30,6 +30,17 @@ module Workhorse
|
|
30
30
|
# ExceptionNotifier.notify_exception(exception)
|
31
31
|
end
|
32
32
|
|
33
|
+
# If set to `true`, the defined `on_exception` will not be called when the
|
34
|
+
# poller encounters an exception and the worker has to be shut down. The
|
35
|
+
# exception will still be logged.
|
36
|
+
mattr_accessor :silence_poller_exceptions
|
37
|
+
self.silence_poller_exceptions = false
|
38
|
+
|
39
|
+
# If set to `true`, the `watch` command won't produce any output. This does
|
40
|
+
# not include warnings such as the "development mode" warning.
|
41
|
+
mattr_accessor :silence_watcher
|
42
|
+
self.silence_watcher = false
|
43
|
+
|
33
44
|
mattr_accessor :perform_jobs_in_tx
|
34
45
|
self.perform_jobs_in_tx = true
|
35
46
|
|
data/lib/workhorse/daemon.rb
CHANGED
@@ -38,21 +38,21 @@ module Workhorse
|
|
38
38
|
@workers << Worker.new(@workers.size + 1, name, &block)
|
39
39
|
end
|
40
40
|
|
41
|
-
def start
|
41
|
+
def start(quiet: false)
|
42
42
|
code = 0
|
43
43
|
|
44
44
|
for_each_worker do |worker|
|
45
45
|
pid_file, pid = read_pid(worker)
|
46
46
|
|
47
47
|
if pid_file && pid
|
48
|
-
warn "Worker ##{worker.id} (#{worker.name}): Already started (PID #{pid})"
|
48
|
+
warn "Worker ##{worker.id} (#{worker.name}): Already started (PID #{pid})" unless quiet
|
49
49
|
code = 1
|
50
50
|
elsif pid_file
|
51
51
|
File.delete pid_file
|
52
|
-
puts "Worker ##{worker.id} (#{worker.name}): Starting (stale pid file)"
|
52
|
+
puts "Worker ##{worker.id} (#{worker.name}): Starting (stale pid file)" unless quiet
|
53
53
|
start_worker worker
|
54
54
|
else
|
55
|
-
warn "Worker ##{worker.id} (#{worker.name}): Starting"
|
55
|
+
warn "Worker ##{worker.id} (#{worker.name}): Starting" unless quiet
|
56
56
|
start_worker worker
|
57
57
|
end
|
58
58
|
end
|
@@ -109,7 +109,7 @@ module Workhorse
|
|
109
109
|
end
|
110
110
|
|
111
111
|
if should_be_running && status(quiet: true) != 0
|
112
|
-
return start
|
112
|
+
return start(quiet: Workhorse.silence_watcher)
|
113
113
|
else
|
114
114
|
return 0
|
115
115
|
end
|
data/lib/workhorse/poller.rb
CHANGED
@@ -35,7 +35,7 @@ module Workhorse
|
|
35
35
|
rescue Exception => e
|
36
36
|
worker.log %(Poll encountered exception:\n#{e.message}\n#{e.backtrace.join("\n")})
|
37
37
|
worker.log 'Worker shutting down...'
|
38
|
-
Workhorse.on_exception.call(e)
|
38
|
+
Workhorse.on_exception.call(e) unless Workhorse.silence_poller_exceptions
|
39
39
|
@running = false
|
40
40
|
worker.instance_variable_get(:@pool).shutdown
|
41
41
|
break
|
data/workhorse.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: workhorse 1.0.0.
|
2
|
+
# stub: workhorse 1.0.0.beta2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "workhorse".freeze
|
6
|
-
s.version = "1.0.0.
|
6
|
+
s.version = "1.0.0.beta2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Sitrox".freeze]
|
11
|
-
s.date = "2020-08-
|
11
|
+
s.date = "2020-08-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/detect_stale_jobs_job.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/scoped_env.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: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sitrox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|