judoscale-rails 1.8.1 → 1.8.2

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: '08ec2299c78c7d9a2cb79c0460d5fc4d6afe6587e346fd61f280ef2e3a87ccb3'
4
- data.tar.gz: 0b8fa857bbf4e4bc64698bbb774e43203855d1de6f9db258280ccfccc4fa3765
3
+ metadata.gz: 9d8b3234f5b38e406752bc3c41dfa9b9c082d11e4b91f601e5ce44d7c813e294
4
+ data.tar.gz: 8eedc0cf76ad08501f21e526acd05dbe25f293bca890b1d04846145b99e83120
5
5
  SHA512:
6
- metadata.gz: 68a24398f5a7abdfb8ed69ae2a7fa01d561c9529c7233724c187043237aeb2c571b5afa686c0912f70476d35789f9b63f62fd68d2c9ea81ae8dd6637b7350770
7
- data.tar.gz: '09eb5087f00eea618536d9f3956e7e217d4517d21f6f3c25a0023f280fd1210ac5f85537b501b971ce929d9e9948719387fec3b68c9653c05e22569652267ce8'
6
+ metadata.gz: 6264a06c16e8ded6e787442f04b0e5c6545c695c86118a4e95109360764ce04e0335858e346428a74200f2bbf021e27497f00e43c17bf1fa265ca05b70ef30ad
7
+ data.tar.gz: 3db9bd2e80abd07c82685bd5273e7f444381a97af2d6fb404855806bb418828f35e9382963aa5822b4c7281fa4dfac79d9074c3176773308229b888be312c42d
@@ -3,11 +3,12 @@ require "judoscale/config"
3
3
  module Judoscale
4
4
  module Rails
5
5
  module Config
6
- attr_accessor :start_reporter_after_initialize
6
+ attr_accessor :start_reporter_after_initialize, :rake_task_ignore_regex
7
7
 
8
8
  def reset
9
9
  super
10
10
  @start_reporter_after_initialize = true
11
+ @rake_task_ignore_regex = /assets:|db:/
11
12
  end
12
13
  end
13
14
 
@@ -12,9 +12,9 @@ module Judoscale
12
12
  class Railtie < ::Rails::Railtie
13
13
  include Judoscale::Logger
14
14
 
15
- def in_rails_console?
16
- # This is gross, but we can't find a more reliable way to detect if we're in a Rails console.
17
- caller.any? { |call| call.include?("console_command.rb") }
15
+ def in_rails_console_or_runner?
16
+ # This is gross, but we can't find a more reliable way to detect if we're in a Rails console/runner.
17
+ caller.any? { |call| call.include?("console_command.rb") || call.include?("runner_command.rb") }
18
18
  end
19
19
 
20
20
  def in_rake_task?(task_regex)
@@ -36,9 +36,9 @@ module Judoscale
36
36
  end
37
37
 
38
38
  config.after_initialize do
39
- if in_rails_console?
40
- logger.debug "No reporting since we're in a Rails console"
41
- elsif in_rake_task?(/assets:|db:/)
39
+ if in_rails_console_or_runner?
40
+ logger.debug "No reporting since we're in a Rails console or runner process"
41
+ elsif in_rake_task?(judoscale_config.rake_task_ignore_regex)
42
42
  logger.debug "No reporting since we're in a build process"
43
43
  elsif judoscale_config.start_reporter_after_initialize
44
44
  Reporter.start
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judoscale-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-09-10 00:00:00.000000000 Z
13
+ date: 2024-10-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: judoscale-ruby
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.8.1
21
+ version: 1.8.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.8.1
28
+ version: 1.8.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: railties
31
31
  requirement: !ruby/object:Gem::Requirement