rookout 0.1.39 → 0.1.40

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: fb5d9fef64ead13081355d267ad49671d0ca9ddf3e916ab5cf556d6d3b5997be
4
- data.tar.gz: e114be3eb5224761c01f5a64bd4f367a90effed5d130c61f90ab4a8328152928
3
+ metadata.gz: 7605e9deab6fab2b1456185132e9db8100f143e0486a6cbef13a20a368047ad1
4
+ data.tar.gz: 900c58be123cfad2b749a16dce8ed3e6fa572af1177ee3778fe9318c02a2f81b
5
5
  SHA512:
6
- metadata.gz: 1da019cfc4c4cbeada393163a6fb4fa01826fdfe9d76edfd0926218b40d6dbedafb2291de4c63a558ac521bf6d360fee76a8522b2a10d021ce7d3538ce1ae530
7
- data.tar.gz: 0a24f0bee3b44a23c9ad1ab7e1cdd6c6fc694e50358abd9d96b219ab3a5116c6567ebfd94a498de0de3cda523605fe2d0d27617d3aca7a9161689eeaa9132131
6
+ metadata.gz: 0d4bf7792481a091c0110353cf727f44486b08dd099bba996ce83c7b05e88213f8a714dcbfb2840944876a49a8a794f2496c501c1c19ec5c341f1493ab925ace
7
+ data.tar.gz: 5069a96af2a1a11b0e7d07be6def3a42bdbf0b94658bc16ff652d06ae623295f5c9b4ea02cbee21cae3d68a236f283568d0136d04edcc51937c68c4a31ba635b
@@ -81,6 +81,7 @@ module Rookout
81
81
  rate_limit = parse_rate_limit Rookout::Config.global_rate_limit, "0", 0, 0
82
82
  @global_rate_limiter = AugRateLimiter.new(*rate_limit)
83
83
  Logger.instance.debug "Using global rate limiter with configuration: #{rate_limit}"
84
+ Rookout::Config.using_global_rate_limiter = true
84
85
  end
85
86
 
86
87
  @global_rate_limiter
@@ -35,7 +35,7 @@ module Rookout
35
35
 
36
36
  # If exceeding quota
37
37
  if usage > @quota
38
- warning = Processor::RookError.new Exceptions::RookRuleRateLimited.new
38
+ warning = Processor::RookError.new Exceptions::RookRuleRateLimited.create
39
39
  UserWarnings.notify_warning warning
40
40
  return false
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "b34115d35e36dcb568599cc5279fc7e934619ef5".freeze
2
+ COMMIT = "c62d573f33d1f62ad05aec7d28a4757fafb9a2b4".freeze
3
3
  end
@@ -77,8 +77,10 @@ module Rookout
77
77
  Rookout::Config.true_values = ["y", "Y", "yes", "Yes", "YES", "true", "True", "TRUE", "1"]
78
78
 
79
79
  attr_accessor :global_rate_limit
80
+ attr_accessor :using_global_rate_limiter
80
81
 
81
82
  Rookout::Config.global_rate_limit = nil
83
+ Rookout::Config.using_global_rate_limiter = false
82
84
 
83
85
  def update_config configuration
84
86
  update_var2_config configuration
@@ -95,13 +95,29 @@ module Rookout
95
95
  end
96
96
  end
97
97
 
98
- class RookRuleRateLimited < ToolException
98
+ class RookRuleAugRateLimited < ToolException
99
99
  def initialize
100
100
  super "Breakpoint was disabled due to rate-limiting. " \
101
101
  "For more information: https://docs.rookout.com/docs/breakpoints-tasks.html#rate-limiting"
102
102
  end
103
103
  end
104
104
 
105
+ class RookRuleGlobalRateLimited < ToolException
106
+ def initialize
107
+ super "Breakpoint was disabled due to global rate-limiting. " \
108
+ "For more information: https://docs.rookout.com/docs/breakpoints-tasks.html#rate-limiting"
109
+ end
110
+ end
111
+
112
+ class RookRuleRateLimited
113
+ def self.create
114
+ if Rookout::Config.using_global_rate_limiter
115
+ return RookRuleGlobalRateLimited.new
116
+ end
117
+ RookRuleAugRateLimited.new
118
+ end
119
+ end
120
+
105
121
  class RookInvalidToken < ToolException
106
122
  def initialize token = ""
107
123
  super "The Rookout token supplied #{token[0..6]} is not valid; please check the token and try again",
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.39".freeze
2
+ VERSION = "0.1.40".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rookout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.39
4
+ version: 0.1.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-05 00:00:00.000000000 Z
11
+ date: 2022-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller