workhorse 1.2.17.rc2 → 1.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +36 -20
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/test/lib/test_helper.rb +6 -7
- data/test/workhorse/daemon_test.rb +5 -2
- data/test/workhorse/worker_test.rb +1 -1
- data/workhorse.gemspec +4 -4
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c3223be9f4d677fa59d215519c9b96e933e5ab37f3ad96e904cd6dc91b59488
|
4
|
+
data.tar.gz: c30eaa0c15cd8785caf0aab8800de9c8838ff62d9192e1d8d9e8a386659322e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d79e67c853bf5b258ccc2d334de5c746c046b6fca063907cdc3e0a8693e641d12cbefb3ce408f69f697dd1b8f7b0ee4e6ccfcd98ed4b86210786ee53bf23e01
|
7
|
+
data.tar.gz: eca0f05a85ed9a9afaeb0d146b8243b02c3d8bd5cf1229488eacae4437494df1554ce7c2f0cf2f97118b8024d2698d6d054aef3039ab19a253497e4a6caab54f
|
data/.github/workflows/ruby.yml
CHANGED
@@ -12,7 +12,13 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
fail-fast: false
|
14
14
|
matrix:
|
15
|
-
ruby-version:
|
15
|
+
ruby-version:
|
16
|
+
- '2.5.1'
|
17
|
+
- '2.6.2'
|
18
|
+
- '2.7.1'
|
19
|
+
- '3.0.1'
|
20
|
+
- '3.1.2'
|
21
|
+
- '3.2.1'
|
16
22
|
env:
|
17
23
|
DB_DATABASE: workhorse
|
18
24
|
DB_USER: root
|
@@ -20,22 +26,32 @@ jobs:
|
|
20
26
|
DB_HOST: localhost
|
21
27
|
|
22
28
|
steps:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Ruby
|
31
|
+
uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby-version }}
|
34
|
+
bundler-cache: true
|
35
|
+
- name: Startup database
|
36
|
+
run: |
|
37
|
+
sudo /etc/init.d/mysql start
|
38
|
+
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE ${{ env.DB_DATABASE }};'
|
39
|
+
- name: Run rake tests
|
40
|
+
uses: nick-fields/retry@v2
|
41
|
+
with:
|
42
|
+
timeout_seconds: 120
|
43
|
+
retry_on: error
|
44
|
+
max_attempts: 3
|
45
|
+
command: bundle exec rake test TESTOPTS='--verbose'
|
46
|
+
|
47
|
+
linters:
|
48
|
+
runs-on: ubuntu-latest
|
49
|
+
steps:
|
50
|
+
- uses: actions/checkout@v2
|
51
|
+
- name: Set up Ruby
|
52
|
+
uses: ruby/setup-ruby@v1
|
53
|
+
with:
|
54
|
+
ruby-version: 2.5.1
|
55
|
+
bundler-cache: true
|
56
|
+
- name: Run rubocop
|
57
|
+
run: bundle exec rubocop
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.17
|
1
|
+
1.2.17
|
data/test/lib/test_helper.rb
CHANGED
@@ -102,12 +102,10 @@ class WorkhorseTest < ActiveSupport::TestCase
|
|
102
102
|
@daemon = Workhorse::Daemon.new(pidfile: 'tmp/pids/test%s.pid') do |d|
|
103
103
|
workers.times do |i|
|
104
104
|
d.worker "Test Worker #{i}" do
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
)
|
110
|
-
end
|
105
|
+
Workhorse::Worker.start_and_wait(
|
106
|
+
pool_size: 1,
|
107
|
+
polling_interval: 0.1
|
108
|
+
)
|
111
109
|
end
|
112
110
|
end
|
113
111
|
end
|
@@ -130,7 +128,8 @@ class WorkhorseTest < ActiveSupport::TestCase
|
|
130
128
|
end
|
131
129
|
|
132
130
|
def capture_stderr
|
133
|
-
old
|
131
|
+
old = $stderr
|
132
|
+
$stderr = StringIO.new
|
134
133
|
yield
|
135
134
|
$stderr.string
|
136
135
|
ensure
|
@@ -16,6 +16,9 @@ class Workhorse::DaemonTest < WorkhorseTest
|
|
16
16
|
# Kill first worker
|
17
17
|
Process.kill 'KILL', daemon.workers.first.pid
|
18
18
|
|
19
|
+
# Short sleep to let the `KILL` propagate
|
20
|
+
sleep 0.2
|
21
|
+
|
19
22
|
# Watch
|
20
23
|
assert_watch_output(
|
21
24
|
'Worker #1 (Test Worker 0): Starting (stale pid file)',
|
@@ -28,7 +31,7 @@ class Workhorse::DaemonTest < WorkhorseTest
|
|
28
31
|
with_daemon 2 do
|
29
32
|
# Kill first worker
|
30
33
|
kill daemon.workers.first.pid
|
31
|
-
FileUtils.rm
|
34
|
+
FileUtils.rm 'tmp/pids/test1.pid'
|
32
35
|
|
33
36
|
# Watch
|
34
37
|
assert_watch_output(
|
@@ -59,7 +62,7 @@ class Workhorse::DaemonTest < WorkhorseTest
|
|
59
62
|
with_daemon 4 do
|
60
63
|
# Worker 0: Kill, remove PID
|
61
64
|
kill daemon.workers[0].pid
|
62
|
-
FileUtils.rm
|
65
|
+
FileUtils.rm 'tmp/pids/test1.pid'
|
63
66
|
|
64
67
|
# Worker 1: Kill, keep PID
|
65
68
|
kill daemon.workers[1].pid
|
data/workhorse.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: workhorse 1.2.17
|
2
|
+
# stub: workhorse 1.2.17 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "workhorse".freeze
|
6
|
-
s.version = "1.2.17
|
6
|
+
s.version = "1.2.17"
|
7
7
|
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
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 = "2024-02-
|
11
|
+
s.date = "2024-02-21"
|
12
12
|
s.files = [".github/workflows/ruby.yml".freeze, ".gitignore".freeze, ".releaser_config".freeze, ".rubocop.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/active_job_extension.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/daemon_test.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.4.6".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.2.17
|
4
|
+
version: 1.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sitrox
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -178,8 +178,8 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
description:
|
182
|
-
email:
|
181
|
+
description:
|
182
|
+
email:
|
183
183
|
executables: []
|
184
184
|
extensions: []
|
185
185
|
extra_rdoc_files: []
|
@@ -229,10 +229,10 @@ files:
|
|
229
229
|
- test/workhorse/pool_test.rb
|
230
230
|
- test/workhorse/worker_test.rb
|
231
231
|
- workhorse.gemspec
|
232
|
-
homepage:
|
232
|
+
homepage:
|
233
233
|
licenses: []
|
234
234
|
metadata: {}
|
235
|
-
post_install_message:
|
235
|
+
post_install_message:
|
236
236
|
rdoc_options: []
|
237
237
|
require_paths:
|
238
238
|
- lib
|
@@ -243,12 +243,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
version: '0'
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- - "
|
246
|
+
- - ">="
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
248
|
+
version: '0'
|
249
249
|
requirements: []
|
250
|
-
rubygems_version: 3.4.
|
251
|
-
signing_key:
|
250
|
+
rubygems_version: 3.4.6
|
251
|
+
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Multi-threaded job backend with database queuing for ruby.
|
254
254
|
test_files:
|