good_job 3.30.0 → 3.30.1

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: 7a62f9aed6b7846a54575fc79d8bb6e164f4236a0e1089eeaf2d2d7ded5e2561
4
- data.tar.gz: cf93bd4a95f4cbd143442ecb5e4d3a1eff77cdecd9e703ee711ea22d2aba2b4e
3
+ metadata.gz: 5ca44ad0fbf6d55478287f58fb49c9295ebcbbb5875ec8c3c2e94859dec23393
4
+ data.tar.gz: ded000fbd60a45e9028a97bda6f1dc0240310a7b9281708d15543331a8a19706
5
5
  SHA512:
6
- metadata.gz: aca712916a3b886d92ae128ee6f238a20a6af8d13bfba3b33b4064820fcbe3317f077fb6a4eac39377f14dcfb10078f0e2ed4c21f81ad9422e59769982aa6d8c
7
- data.tar.gz: 2adc01f26ea9e2155073224a1cf9a42049c63f67c7bb5ffc87f07c1dd95f30cbbd958b15f9b50e0bbf645e132b331f592c9aa6cf182b110484bc807f6b024ef2
6
+ metadata.gz: 4d09ea0dcb8801f3ca577b349e9f671bdf70c4df38ace8b96e9b5bda8f22bc2bc4791a261c4816e2beca82aa17f188c9521f89be4460f4097d5e8a03a4f2c281
7
+ data.tar.gz: 73ab002472752c47682c508b4828dfd359e9aebebc997b76f69c91f6cf5dd0ab12a4bc171fbc6f3d967e17b2a4b26a52f6afe311d43dbc90331c565a79443e25
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.30.1](https://github.com/bensheldon/good_job/tree/v3.30.1) (2024-07-06)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.30.0...v3.30.1)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Fix Performance table formatting, change url from `performances` to singular `performance` [\#1393](https://github.com/bensheldon/good_job/pull/1393) ([bensheldon](https://github.com/bensheldon))
10
+ - Add a version check for Rails whether to use pg interval or calculate float [\#1389](https://github.com/bensheldon/good_job/pull/1389) ([bensheldon](https://github.com/bensheldon))
11
+
12
+ **Merged pull requests:**
13
+
14
+ - Add missing newline after frozen string literal for migrations [\#1392](https://github.com/bensheldon/good_job/pull/1392) ([Earlopain](https://github.com/Earlopain))
15
+ - Temporarily remove JRuby builds [\#1391](https://github.com/bensheldon/good_job/pull/1391) ([bensheldon](https://github.com/bensheldon))
16
+ - Add initial Performance panel to dashboard [\#1388](https://github.com/bensheldon/good_job/pull/1388) ([bensheldon](https://github.com/bensheldon))
17
+ - Move job execution logic from Execution to BaseExecution to simplify v4 changes [\#1357](https://github.com/bensheldon/good_job/pull/1357) ([bensheldon](https://github.com/bensheldon))
18
+
3
19
  ## [v3.30.0](https://github.com/bensheldon/good_job/tree/v3.30.0) (2024-07-05)
4
20
 
5
21
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.29.5...v3.30.0)
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoodJob
4
+ class PerformancesController < ApplicationController
5
+ def show
6
+ if GoodJob::DiscreteExecution.duration_interval_migrated?
7
+ @performances = GoodJob::DiscreteExecution
8
+ .where.not(job_class: nil)
9
+ .group(:job_class)
10
+ .select("
11
+ job_class,
12
+ COUNT(*) AS executions_count,
13
+ AVG(duration) AS avg_duration,
14
+ MIN(duration) AS min_duration,
15
+ MAX(duration) AS max_duration
16
+ ")
17
+ .order("job_class")
18
+ else
19
+ @needs_upgrade = true
20
+ end
21
+ end
22
+ end
23
+ end
@@ -33,7 +33,7 @@ module GoodJob
33
33
 
34
34
  def job_classes
35
35
  filtered_query(params.slice(:queue_name)).unscope(:select)
36
- .group(GoodJob::BaseExecution.params_job_class).count
36
+ .group(GoodJob::Job.params_job_class).count
37
37
  .sort_by { |name, _count| name.to_s }
38
38
  .to_h
39
39
  end
@@ -9,6 +9,7 @@ module GoodJob
9
9
 
10
10
  def format_duration(sec)
11
11
  return unless sec
12
+ return "" if sec.is_a?(String) # pg interval support added in Rails 6.1
12
13
 
13
14
  if sec < 1
14
15
  t 'good_job.duration.milliseconds', ms: (sec * 1000).floor
@@ -27,7 +27,7 @@ module GoodJob
27
27
  def error_event
28
28
  return unless self.class.columns_hash['error_event']
29
29
 
30
- enum = super
30
+ enum = read_attribute(:error_event)
31
31
  return unless enum
32
32
 
33
33
  ERROR_EVENT_ENUMS.key(enum)
@@ -39,7 +39,7 @@ module GoodJob
39
39
  enum = ERROR_EVENT_ENUMS[event]
40
40
  raise(ArgumentError, "Invalid error_event: #{event}") if event && !enum
41
41
 
42
- super(enum)
42
+ write_attribute(:error_event, enum)
43
43
  end
44
44
  end
45
45
  end