safe_request_timeout 1.0.0 → 1.0.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: 742cdb842214b5b66fa2fb127c79005ce2b3072776c59a20564433a9f5e82a8c
4
- data.tar.gz: 592e4127ace138dadeabcf7e9dc5bbb129a20e8895e600a009e588249cea668f
3
+ metadata.gz: 1fb790302089e758479b7c2ec238ba5ad66d5f2cd01388c4be8679b3c15c7057
4
+ data.tar.gz: 9358570335e15cfe58340edb0c7b9ec9d3cf436b698fe34dd5164c8532101c6b
5
5
  SHA512:
6
- metadata.gz: 61be0a04e1f993c83dd520c151d7a76817be66eff64200898d336cfda5e70668c53a320462a5c161818e017ad17c6ab39c11fc2ceae1405c5ca1682eb511b17e
7
- data.tar.gz: bcf57aafa0db0db508283d5c6f49ec611a6b3366e19542a014015f731e623c3dfc1f9eda4b239661f24b673a9310887355a37dbed568489fe7961ebda8d108dc
6
+ metadata.gz: 431be87c04f338cca58f4376cbcc71a7dbe2dbafd09457d9cc427cb96a8130bbd01b5e19bc45bbb895927119b55e50ff4ba023d1e6e009a25b481866fad55091
7
+ data.tar.gz: 010ebff4d68d374cd403a5480a856a20d84b9fb5b73d931ec32f4821e1c7cd298c08bf0fdd4d8840c1b4297df0e75ffa6bac7be27764c4b209284635002eeb07
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 1.0.2
8
+
9
+ ### Added
10
+ - Added support for ActiveRecord 7.1.
11
+
12
+ ## 1.0.1
13
+
14
+ ### Fixed
15
+ - Handle case in Railtie where database connection not available.
16
+
7
17
  ## 1.0.0
8
18
 
9
19
  ### Added
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # Request Timeout
1
+ # Safe Request Timeout
2
2
 
3
3
  [![Continuous Integration](https://github.com/bdurand/safe_request_timeout/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/bdurand/safe_request_timeout/actions/workflows/continuous_integration.yml)
4
+ [![Regression Test](https://github.com/bdurand/safe_request_timeout/actions/workflows/regression_test.yml/badge.svg)](https://github.com/bdurand/safe_request_timeout/actions/workflows/regression_test.yml)
4
5
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
5
6
 
6
7
  This gem provides a safe and convenient mechanism for adding a timeout mechanism to a block of code. The gem ensures that the timeout is safe to call and will not raise timeout errors from random places in your code which can leave your application in an indeterminate state.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.2
@@ -9,8 +9,9 @@ module SafeRequestTimeout
9
9
  # @return [void]
10
10
  def add_timeout!(connection_class = nil)
11
11
  connection_class ||= ::ActiveRecord::Base.connection.class
12
+ exec_method = (connection_class.instance_methods.include?(:internal_exec_query) ? :internal_exec_query : :exec_query)
12
13
 
13
- SafeRequestTimeout::Hooks.add_timeout!(connection_class, [:exec_query])
14
+ SafeRequestTimeout::Hooks.add_timeout!(connection_class, [exec_method])
14
15
 
15
16
  SafeRequestTimeout::Hooks.clear_timeout!(connection_class, [:commit_db_transaction])
16
17
  end
@@ -9,7 +9,11 @@ module SafeRequestTimeout
9
9
  initializer "safe_request_timeout" do |app|
10
10
  if app.config.safe_request_timeout.active_record_hook
11
11
  ActiveSupport.on_load(:active_record) do
12
- SafeRequestTimeout::ActiveRecordHook.add_timeout!
12
+ begin
13
+ SafeRequestTimeout::ActiveRecordHook.add_timeout!
14
+ rescue ActiveRecord::ActiveRecordError => e
15
+ Rails.logger&.warn("Could not add ActiveRecord hook for SafeRequestTimeout: #{e.inspect}")
16
+ end
13
17
  end
14
18
  end
15
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_request_timeout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-30 00:00:00.000000000 Z
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis