berater 0.15.0 → 0.15.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: 81f3c362a1360d2b3f3b4a2829b374dd38f0f9de6809737efe7d9bb44ffbd88c
4
- data.tar.gz: cbad555e49e5ac86d63f99486139e6df13b9da4289832b2d8cf5034bd7140018
3
+ metadata.gz: dcfe29f7b98bcd132e05ba7cadbc05a128da9f4737eaa383e330bfd4d72832fb
4
+ data.tar.gz: 7750d96b8df130de0e9dd11c81f69b021543567c6e7f63087839dc17bbaf309c
5
5
  SHA512:
6
- metadata.gz: ed26b29a67a30db075ec18ab64698b6ae76dbe7d4d8aee64c290dc449a6867566ea3c8155eb6ec6c5fe440208c19345bfc02c30adcddb4356b591f784678df99
7
- data.tar.gz: 56143daeb1069e5d1162bea25c9892f146009168f8ef42c23cdc78774e6148602ef40364423c94e5248d2cff99793e6e5ef6a676e918ec4cf23d2686a35b5927
6
+ metadata.gz: d17e3d67ebdc5644348011b1d03b5850bceeeae4533d25a6a67f1cdadf8071312c0a397ae15560f01ad7ef123f68dfd7a19c55040ff5af5b7c17883f0c33f265
7
+ data.tar.gz: 95d37d05e057c5b536ce724308a91f1be09211a3e3687dced98618f5836d9d992b4dfb51f00b074a65dd36e9664344b032703f02c9883600db348b411b2f18e2
@@ -52,10 +52,12 @@ module Berater
52
52
 
53
53
  acquire_lock(capacity: capacity, cost: cost, **opts)
54
54
  rescue NoMethodError => e
55
- raise unless e.message.include?("undefined method `evalsha' for")
55
+ if e.message.include?("undefined method `evalsha' for")
56
+ # repackage error so it's easier to understand
57
+ raise RuntimeError, "invalid redis connection: #{redis}"
58
+ end
56
59
 
57
- # repackage error so it's easier to understand
58
- raise RuntimeError, "invalid redis connection: #{redis}"
60
+ raise
59
61
  end
60
62
 
61
63
  def utilization
@@ -111,7 +113,7 @@ module Berater
111
113
  @capacity = capacity
112
114
  end
113
115
 
114
- def acquire_lock(capacity:, cost:)
116
+ def acquire_lock(**options)
115
117
  raise NotImplementedError
116
118
  end
117
119
 
@@ -3,9 +3,12 @@ require 'set'
3
3
  module Berater
4
4
  module Middleware
5
5
  class FailOpen
6
- ERRORS = Set[
6
+ ERRORS = Set.new [
7
7
  Redis::BaseConnectionError,
8
- ]
8
+ SystemCallError, # openssl
9
+ Timeout::Error, # connection pool
10
+ (OpenSSL::OpenSSLError if defined?(OpenSSL)),
11
+ ].compact
9
12
 
10
13
  def initialize(errors: nil, on_fail: nil)
11
14
  @errors = errors || ERRORS
@@ -11,7 +11,7 @@ module Berater
11
11
  tracer.trace('Berater') do |span|
12
12
  begin
13
13
  lock = yield
14
- rescue Exception => error
14
+ rescue StandardError => error
15
15
  # capture exception for reporting, then propagate
16
16
  raise
17
17
  ensure
@@ -1,3 +1,3 @@
1
1
  module Berater
2
- VERSION = "0.15.0"
2
+ VERSION = "0.15.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-13 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: meddleware
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  requirements: []
207
- rubygems_version: 3.3.7
207
+ rubygems_version: 3.2.33
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Berater