workhorse 1.2.19 → 1.2.20

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: 4ee79a0aad4b594650de92485a2a0f4d95364042fe1ce8ebd4a2be075827d07d
4
- data.tar.gz: a2dcfbdc9e1152513e9fb02613d1f219c3849f85797716e431f0a2fb84fae654
3
+ metadata.gz: 5779f0370ad5f8c4c99389c7c089d45d68820e9f63703a7886b9b702ba3b9fd3
4
+ data.tar.gz: fd220b5a403be4a901446b9a1bc55d6acfaf8e6b5302a205d79a20f47951c6cf
5
5
  SHA512:
6
- metadata.gz: 99496e59a85fad0b8ca3fe3d9a24b4fd30fd8be3a9e0a236f584dffc42bfda37ba91a5224dfcd29aee88de72ea1df234df286262b5777daf9edb8cfffa0dc2f8
7
- data.tar.gz: 13eee5ce97cfc0e66ef4b99a9132590230cc636d202f6e05e9757288dc0ba05e0fd916052bd3638464d0ecb0fafd868004fdc810c4f45f3d0a79350253a17b75
6
+ metadata.gz: 66a64fc3dc59ed726cb7cdc4774c979bcfafb1246c67e52cac74ff87da9509369fababe6d294fb9943ad8c42a97a41d955277ae07b91e9491f07618a530d6dff
7
+ data.tar.gz: 1264727996bd00beb9d0f0968e82e34de174ee1529977f55ae87a5a47ec4a70d7c8caa93a3ed78e9816740fb894d748b022a1fe574303f63f9c497a2abf3454b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Workhorse Changelog
2
2
 
3
+ ## 1.2.20 - 2024-06-17
4
+
5
+ * Fix rails environment check
6
+
7
+ Sitrox reference: #125593.
8
+
3
9
  ## 1.2.19 - 2024-05-07
4
10
 
5
11
  * Fix further compatibility issues with `ruby < 2.5`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.19
1
+ 1.2.20
@@ -168,6 +168,8 @@ module Workhorse
168
168
  end
169
169
 
170
170
  def start_worker(worker)
171
+ check_rails_env if defined?(Rails)
172
+
171
173
  pid = fork do
172
174
  $0 = process_name(worker)
173
175
  # Reopen pipes to prevent #107576
@@ -244,5 +246,11 @@ module Workhorse
244
246
 
245
247
  return file, pid, active
246
248
  end
249
+
250
+ def check_rails_env
251
+ unless Rails.env.production?
252
+ warn 'WARNING: Always run workhorse workers in production environment. Other environments can lead to unexpected behavior.'
253
+ end
254
+ end
247
255
  end
248
256
  end
@@ -67,8 +67,6 @@ module Workhorse
67
67
  if instant_repolling
68
68
  @pool.on_idle { @poller.instant_repoll! }
69
69
  end
70
-
71
- check_rails_env if defined?(Rails)
72
70
  end
73
71
 
74
72
  def log(text, level = :info)
@@ -196,12 +194,6 @@ module Workhorse
196
194
  return mem.to_i / 1024
197
195
  end
198
196
 
199
- def check_rails_env
200
- unless Rails.env.production?
201
- warn 'WARNING: Always run workhorse workers in production environment. Other environments can lead to unexpected behavior.'
202
- end
203
- end
204
-
205
197
  def trap_log_reopen
206
198
  Signal.trap(LOG_REOPEN_SIGNAL) do
207
199
  Thread.new do
data/workhorse.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: workhorse 1.2.19 ruby lib
2
+ # stub: workhorse 1.2.20 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "workhorse".freeze
6
- s.version = "1.2.19"
6
+ s.version = "1.2.20"
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 = "2024-05-07"
11
+ s.date = "2024-06-17"
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.19
4
+ version: 1.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-07 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler