good_job 4.6.0 → 4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/README.md +30 -1
- data/app/controllers/good_job/metrics_controller.rb +2 -0
- data/app/controllers/good_job/pauses_controller.rb +34 -0
- data/app/controllers/good_job/performance_controller.rb +15 -11
- data/app/models/good_job/cron_entry.rb +11 -1
- data/app/models/good_job/job.rb +28 -1
- data/app/models/good_job/setting.rb +78 -0
- data/app/views/good_job/batches/_jobs.erb +7 -0
- data/app/views/good_job/jobs/_table.erb +7 -0
- data/app/views/good_job/pauses/_group.html.erb +28 -0
- data/app/views/good_job/pauses/_pause.html.erb +8 -0
- data/app/views/good_job/pauses/index.html.erb +46 -0
- data/app/views/good_job/performance/index.html.erb +46 -2
- data/app/views/good_job/shared/_navbar.erb +6 -0
- data/config/locales/de.yml +18 -2
- data/config/locales/en.yml +18 -2
- data/config/locales/es.yml +19 -3
- data/config/locales/fr.yml +36 -20
- data/config/locales/it.yml +20 -4
- data/config/locales/ja.yml +20 -4
- data/config/locales/ko.yml +21 -5
- data/config/locales/nl.yml +22 -6
- data/config/locales/pt-BR.yml +18 -2
- data/config/locales/ru.yml +22 -6
- data/config/locales/tr.yml +20 -4
- data/config/locales/uk.yml +21 -5
- data/config/routes.rb +6 -0
- data/lib/good_job/configuration.rb +12 -0
- data/lib/good_job/version.rb +1 -1
- data/lib/good_job.rb +32 -0
- metadata +7 -6
@@ -35,6 +35,8 @@ module GoodJob
|
|
35
35
|
DEFAULT_DASHBOARD_LIVE_POLL_ENABLED = true
|
36
36
|
# Default enqueue_after_transaction_commit
|
37
37
|
DEFAULT_ENQUEUE_AFTER_TRANSACTION_COMMIT = false
|
38
|
+
# Default enable_pauses setting
|
39
|
+
DEFAULT_ENABLE_PAUSES = false
|
38
40
|
|
39
41
|
def self.validate_execution_mode(execution_mode)
|
40
42
|
raise ArgumentError, "GoodJob execution mode must be one of #{EXECUTION_MODES.join(', ')}. It was '#{execution_mode}' which is not valid." unless execution_mode.in?(EXECUTION_MODES)
|
@@ -369,6 +371,16 @@ module GoodJob
|
|
369
371
|
DEFAULT_ENQUEUE_AFTER_TRANSACTION_COMMIT
|
370
372
|
end
|
371
373
|
|
374
|
+
# Whether the job processing can be paused.
|
375
|
+
# @return [Boolean]
|
376
|
+
def enable_pauses
|
377
|
+
return options[:enable_pauses] unless options[:enable_pauses].nil?
|
378
|
+
return rails_config[:enable_pauses] unless rails_config[:enable_pauses].nil?
|
379
|
+
return ActiveModel::Type::Boolean.new.cast(env['GOOD_JOB_ENABLE_PAUSES']) unless env['GOOD_JOB_ENABLE_PAUSE'].nil?
|
380
|
+
|
381
|
+
DEFAULT_ENABLE_PAUSES
|
382
|
+
end
|
383
|
+
|
372
384
|
# Whether running in a web server process.
|
373
385
|
# @return [Boolean, nil]
|
374
386
|
def in_webserver?
|
data/lib/good_job/version.rb
CHANGED
data/lib/good_job.rb
CHANGED
@@ -292,6 +292,38 @@ module GoodJob
|
|
292
292
|
def self.migrated?
|
293
293
|
GoodJob::BatchRecord.jobs_finished_at_migrated?
|
294
294
|
end
|
295
|
+
|
296
|
+
# Pause job execution for a given queue or job class.
|
297
|
+
# @param queue [String, nil] Queue name to pause
|
298
|
+
# @param job_class [String, nil] Job class name to pause
|
299
|
+
# @return [void]
|
300
|
+
def self.pause(queue: nil, job_class: nil)
|
301
|
+
GoodJob::Setting.pause(queue: queue, job_class: job_class)
|
302
|
+
end
|
303
|
+
|
304
|
+
# Unpause job execution for a given queue or job class.
|
305
|
+
# @param queue [String, nil] Queue name to unpause
|
306
|
+
# @param job_class [String, nil] Job class name to unpause
|
307
|
+
# @param label [String, nil] Label to unpause
|
308
|
+
# @return [void]
|
309
|
+
def self.unpause(queue: nil, job_class: nil, label: nil)
|
310
|
+
GoodJob::Setting.unpause(queue: queue, job_class: job_class, label: label)
|
311
|
+
end
|
312
|
+
|
313
|
+
# Check if job execution is paused for a given queue or job class.
|
314
|
+
# @param queue [String, nil] Queue name to check
|
315
|
+
# @param job_class [String, nil] Job class name to check
|
316
|
+
# @param label [String, nil] Label to check
|
317
|
+
# @return [Boolean]
|
318
|
+
def self.paused?(queue: nil, job_class: nil, label: nil)
|
319
|
+
GoodJob::Setting.paused?(queue: queue, job_class: job_class, label: label)
|
320
|
+
end
|
321
|
+
|
322
|
+
# Get a list of all paused queues and job classes
|
323
|
+
# @return [Hash] Hash with :queues, :job_classes, :labels arrays of paused items
|
324
|
+
def self.paused(type = nil)
|
325
|
+
GoodJob::Setting.paused(type)
|
326
|
+
end
|
295
327
|
end
|
296
328
|
|
297
329
|
ActiveSupport.run_load_hooks(:good_job, GoodJob)
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: good_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activejob
|
@@ -259,6 +258,7 @@ files:
|
|
259
258
|
- app/controllers/good_job/frontends_controller.rb
|
260
259
|
- app/controllers/good_job/jobs_controller.rb
|
261
260
|
- app/controllers/good_job/metrics_controller.rb
|
261
|
+
- app/controllers/good_job/pauses_controller.rb
|
262
262
|
- app/controllers/good_job/performance_controller.rb
|
263
263
|
- app/controllers/good_job/processes_controller.rb
|
264
264
|
- app/filters/good_job/base_filter.rb
|
@@ -313,6 +313,9 @@ files:
|
|
313
313
|
- app/views/good_job/jobs/_table.erb
|
314
314
|
- app/views/good_job/jobs/index.html.erb
|
315
315
|
- app/views/good_job/jobs/show.html.erb
|
316
|
+
- app/views/good_job/pauses/_group.html.erb
|
317
|
+
- app/views/good_job/pauses/_pause.html.erb
|
318
|
+
- app/views/good_job/pauses/index.html.erb
|
316
319
|
- app/views/good_job/performance/index.html.erb
|
317
320
|
- app/views/good_job/performance/show.html.erb
|
318
321
|
- app/views/good_job/processes/index.html.erb
|
@@ -396,7 +399,6 @@ metadata:
|
|
396
399
|
homepage_uri: https://github.com/bensheldon/good_job
|
397
400
|
source_code_uri: https://github.com/bensheldon/good_job
|
398
401
|
rubygems_mfa_required: 'true'
|
399
|
-
post_install_message:
|
400
402
|
rdoc_options:
|
401
403
|
- "--title"
|
402
404
|
- GoodJob - a multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
|
@@ -418,8 +420,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
418
420
|
- !ruby/object:Gem::Version
|
419
421
|
version: '0'
|
420
422
|
requirements: []
|
421
|
-
rubygems_version: 3.
|
422
|
-
signing_key:
|
423
|
+
rubygems_version: 3.6.2
|
423
424
|
specification_version: 4
|
424
425
|
summary: A multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
|
425
426
|
test_files: []
|