workhorse 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/VERSION +1 -1
- data/lib/workhorse/daemon/shell_handler.rb +23 -8
- 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: 8337d1efedcb53b3fd51e983fe235aa2f1e71b6cbfedad84d2becb5c292dfb1c
|
|
4
|
+
data.tar.gz: 6746a5eeb075df326794e135b0336dea076a624e20562184c687d50603c894bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55769be0e335e14684c1e6bbd108b2c9da4fee5cf42b86149a481e0cae1d4a64d542ca0119adea20d83f3f9131dd45d61daa6e88df5e3bacde86231c0bc995b9
|
|
7
|
+
data.tar.gz: da590080ffa2b5f96c1800b730babf019f115b600335a85fc41d343573765e0114eea356c09238507913c2ca1e88cd5d0e3d12742facc201e5b9c5ba1c076188
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Workhorse Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.1 - 2025-11-05
|
|
4
|
+
|
|
5
|
+
* Adapt shell handler locking behavior depending on command:
|
|
6
|
+
|
|
7
|
+
* `usage|<empty string>|<unknown command>`: Does not lock anymore as it
|
|
8
|
+
only shows the usage information.
|
|
9
|
+
|
|
10
|
+
* `watch|kill`: Failing lock. These commands now simply abort if there is
|
|
11
|
+
already another locking command running.
|
|
12
|
+
|
|
13
|
+
* `start|stop|restart|status|restart-logging`: Waiting lock. These commands
|
|
14
|
+
will wait until other commands are finished. This is equal to the previous
|
|
15
|
+
behavior.
|
|
16
|
+
|
|
3
17
|
## 1.3.0 - 2025-09-16
|
|
4
18
|
|
|
5
19
|
* Stable release based on previous RC releases.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.1
|
|
@@ -6,31 +6,33 @@ module Workhorse
|
|
|
6
6
|
exit 99
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
lockfile_path = options.delete(:lockfile) || 'workhorse.lock'
|
|
11
|
-
lockfile = File.open(lockfile_path, 'a')
|
|
12
|
-
lockfile.flock(File::LOCK_EX || File::LOCK_NB)
|
|
13
|
-
else
|
|
14
|
-
lockfile = nil
|
|
15
|
-
end
|
|
16
|
-
|
|
9
|
+
lockfile_path = options.delete(:lockfile) || 'workhorse.lock'
|
|
17
10
|
daemon = Workhorse::Daemon.new(**options, &block)
|
|
18
11
|
|
|
12
|
+
lockfile = nil
|
|
13
|
+
|
|
19
14
|
begin
|
|
20
15
|
case ARGV.first
|
|
21
16
|
when 'start'
|
|
17
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX)
|
|
22
18
|
status = daemon.start
|
|
23
19
|
when 'stop'
|
|
20
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX)
|
|
24
21
|
status = daemon.stop
|
|
25
22
|
when 'kill'
|
|
23
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX | File::LOCK_NB)
|
|
26
24
|
status = daemon.stop(true)
|
|
27
25
|
when 'status'
|
|
26
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX)
|
|
28
27
|
status = daemon.status
|
|
29
28
|
when 'watch'
|
|
29
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX | File::LOCK_NB)
|
|
30
30
|
status = daemon.watch
|
|
31
31
|
when 'restart'
|
|
32
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX)
|
|
32
33
|
status = daemon.restart
|
|
33
34
|
when 'restart-logging'
|
|
35
|
+
lockfile = acquire_lock(lockfile_path, File::LOCK_EX)
|
|
34
36
|
status = daemon.restart_logging
|
|
35
37
|
when 'usage'
|
|
36
38
|
usage
|
|
@@ -88,5 +90,18 @@ module Workhorse
|
|
|
88
90
|
99 on all other errors.
|
|
89
91
|
USAGE
|
|
90
92
|
end
|
|
93
|
+
|
|
94
|
+
private
|
|
95
|
+
|
|
96
|
+
def self.acquire_lock(lockfile_path, flags)
|
|
97
|
+
if Workhorse.lock_shell_commands
|
|
98
|
+
lockfile = File.open(lockfile_path, 'a')
|
|
99
|
+
lockfile.flock(flags)
|
|
100
|
+
|
|
101
|
+
return lockfile
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
return nil
|
|
105
|
+
end
|
|
91
106
|
end
|
|
92
107
|
end
|
data/workhorse.gemspec
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: workhorse 1.3.
|
|
2
|
+
# stub: workhorse 1.3.1 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "workhorse".freeze
|
|
6
|
-
s.version = "1.3.
|
|
6
|
+
s.version = "1.3.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 = "2025-
|
|
11
|
+
s.date = "2025-11-05"
|
|
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,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: workhorse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sitrox
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-11-05 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|