aws-dev-utils 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-dev-utils/backends/redis.rb +5 -5
- data/lib/aws-dev-utils/cache_wrapper.rb +4 -4
- data/lib/aws-dev-utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a8659230582635341c256080cf9799b0a61a1e0b310234f8d86a695460cbba
|
4
|
+
data.tar.gz: 540c636ebcb5c10668575ed17ce64832e9e88932582a89250f85f87db6965900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dcd8e2f81e666beed0e3e96cdaea536024f2acd9f6b839bf9086e42b175af4d9e4d2c997484eb4c2c20d5f763d43bac871159fd046c0b071836924b767e7ad1
|
7
|
+
data.tar.gz: 9ec27b077aa93bba943e5d188fb8fab8ecf80dc2b9e7ff8bff226da57496c379d20b8ee4c6961f869b0f690a6017ca6327d8bbc35aca27a83f8ad41f392b1224
|
@@ -5,20 +5,20 @@ module AwsDevUtils
|
|
5
5
|
class Redis
|
6
6
|
# :nocov:
|
7
7
|
# Initialize a new redis client
|
8
|
-
# @
|
8
|
+
# @param [String] url - specify redis url connection
|
9
9
|
def initialize url='redis://localhost:6379'
|
10
10
|
@redis = ::Redis.new(url: url)
|
11
11
|
end
|
12
12
|
|
13
|
-
# Get the value of key. If not found
|
13
|
+
# Get the value of key. If not found returns nil
|
14
14
|
def get key
|
15
15
|
@redis.get key
|
16
16
|
end
|
17
17
|
|
18
18
|
# Set key to hold the value and set key to timeout after the a given expiration time(in seconds).
|
19
|
-
# @param [Object]
|
20
|
-
# @param [Object]
|
21
|
-
# @param [Integer]
|
19
|
+
# @param key [Object]
|
20
|
+
# @param value [Object]
|
21
|
+
# @param exp [Integer] - the key-value timeout
|
22
22
|
def set key, value, exp
|
23
23
|
@redis.setex key, exp, value
|
24
24
|
end
|
@@ -4,10 +4,10 @@ module AwsDevUtils
|
|
4
4
|
class CacheWrapper
|
5
5
|
include AwsDevUtils::Utils
|
6
6
|
|
7
|
-
# Initialize a new CacheWrapper
|
8
|
-
#
|
9
|
-
# @
|
10
|
-
# @param [Integer]
|
7
|
+
# Initialize a new CacheWrapper, Internal use only
|
8
|
+
#
|
9
|
+
# @param client [Aws client, NextTokenWrapper, RetryWrapper]
|
10
|
+
# @param exp [Integer] - the key-value timeout
|
11
11
|
def initialize client, exp=60
|
12
12
|
@client = client
|
13
13
|
@exp = exp
|