idempotent-request 0.1.1 → 0.1.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: 7d7a529e3aef3790df0207b93cc2568d0796c36d01193a8309f24f815eb78a43
4
- data.tar.gz: 6a70bedce0b0a3bd2456ed504cd2c1a266776ca50a5d7da1e89c441a92bb3a75
3
+ metadata.gz: 25467dbc0ee42d2648e2dd267edb23be7972a6af0ba2d233e21d455c663fc643
4
+ data.tar.gz: 4dc4e7373dce6370eb850134d25c164fd67ef5c54dc12c3585267d4774d1f58f
5
5
  SHA512:
6
- metadata.gz: b29abb27b091e57f83bb8f2cf241d0083653c3e4ce93138f486fd19448e64723419d78923fb662aaa21dec938b06f46cd76c353d444b59a134aa6b2919ec977c
7
- data.tar.gz: 08b45d6a1db58c78274fe099eec5bd5af8f1549c543598b539d3004f97802c87763d8abd54e1bd8b003a75669426be4c2bd96844543e97a985a9fa7a90ec9c3f
6
+ metadata.gz: 9af0cf3e406cbea6807cdfedc32110984ac63225dbe9ffe671cfcd8b842dd639db8e80ead393b1bbb7a14d6977f4edbe02aec913f4a5b2e41093a8cf12577c23
7
+ data.tar.gz: b54740669825c315a164fb42a4a58e54fd1ac1cc6e2802d3c40f4c8e5123bbfb9742e93f53f42667c392982e68784ff3721cb6123e7ea77b41cd4ca3ae762dca
@@ -1,5 +1,10 @@
1
1
  # Idempotent Request Changelog #
2
2
 
3
+ ## v0.1.2 ##
4
+
5
+ * Fix rack response
6
+ * Disuse SETNX (@espadrine)
7
+
3
8
  ## v0.1.1 ##
4
9
 
5
- * Add caching for successful responses (@gomayonqui)
10
+ * Add caching for successful responses (@gomayonqui)
@@ -13,8 +13,14 @@ module IdempotentRequest
13
13
  end
14
14
 
15
15
  def write(key, payload)
16
- redis.setnx(namespaced_key(key), payload)
17
- redis.expire(namespaced_key(key), expire_time.to_i) if expire_time.to_i > 0
16
+ redis.set(
17
+ namespaced_key(key),
18
+ payload,
19
+ {}.tap do |options|
20
+ options[:nx] = true
21
+ options[:ex] = expire_time.to_i if expire_time.to_i > 0
22
+ end
23
+ )
18
24
  end
19
25
 
20
26
  private
@@ -36,7 +36,7 @@ module IdempotentRequest
36
36
  Oj.dump({
37
37
  status: status,
38
38
  headers: headers.to_h,
39
- response: response
39
+ response: Array(response)
40
40
  })
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module IdempotentRequest
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idempotent-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro Zakharov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-19 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack