semian 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aefbea0e823c25d564efb6ab2859f90bd27125b815f097ad1a7aa9e7109e58ba
4
- data.tar.gz: d9c389c8954f6c332018ec36cece20d6847d63a781fec755354151023d5d3646
3
+ metadata.gz: bdff6d43d1dfd0788850d7c003af564610b347a040cdfe1730d2cbcdc279e000
4
+ data.tar.gz: f4c2746c0d41cc91d06f1f1cc702bfd1e2a3e33b8848fd875d8361785c639b75
5
5
  SHA512:
6
- metadata.gz: aa9ea2602e2b9671d83273904bc7d813e5c39a15a3c5938dc03460129b67e7257719a95a6ad4614bdd6255e416f1ef2c7b046a0a3b94a9185cb6b5ab093b2dd1
7
- data.tar.gz: 584f1e7243fa3a28f7de7d59a4b2655616a41800b8e366138aedb20bedfcc9264e18e7a339c95147e062fa7cb18ff27b2edb529c11dcd1ec28c1295fadde5c7d
6
+ metadata.gz: b20d975e290f6597150b89b68f94f1cbb213f3b021a7d187151bdb412f548708bc9744c05065a8e541ecb3300ad34d91062c10a0ae6395bcbca82a7093f8ef93
7
+ data.tar.gz: 4f18b1d5f771e49b8567387daeabce1e84f838f4bfd00ccf0e00f4602557f93b5ced88c675f1e210209fcc847de08eb9a9f5f603b74fea8ab9473b442d3e4452
data/lib/semian/redis.rb CHANGED
@@ -91,6 +91,28 @@ module Semian
91
91
  end
92
92
  end
93
93
 
94
+ def with_resource_timeout(temp_timeout)
95
+ timeout = options[:timeout]
96
+ connect_timeout = options[:connect_timeout]
97
+ read_timeout = options[:read_timeout]
98
+ write_timeout = options[:write_timeout]
99
+
100
+ begin
101
+ connection.timeout = temp_timeout if connected?
102
+ options[:timeout] = Float(temp_timeout),
103
+ options[:connect_timeout] = Float(temp_timeout)
104
+ options[:read_timeout] = Float(temp_timeout)
105
+ options[:write_timeout] = Float(temp_timeout)
106
+ yield
107
+ ensure
108
+ options[:timeout] = timeout
109
+ options[:connect_timeout] = connect_timeout
110
+ options[:read_timeout] = read_timeout
111
+ options[:write_timeout] = write_timeout
112
+ connection.timeout = self.timeout if connected?
113
+ end
114
+ end
115
+
94
116
  private
95
117
 
96
118
  def resource_exceptions
@@ -1,3 +1,3 @@
1
1
  module Semian
2
- VERSION = '0.9.1'
2
+ VERSION = '0.10.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Francis
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-11-14 00:00:00.000000000 Z
13
+ date: 2019-12-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake-compiler