embulk-plugin-redis-url 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/embulk-plugin-redis.gemspec +1 -1
- data/lib/embulk/output/redis.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d442216449555364e1cd2e25e09eef576b921dac
|
4
|
+
data.tar.gz: 29d30688fc1fe2d3cfd1b72f70f0b3bd32562f5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03aae8b10a3074a1de8ac85870204359ef4e61fd6f0df357505a3b50bdf1e6208801cc07741612acaa66df3e480f3807b28177a40ddfc4afdf7a7d860032f79
|
7
|
+
data.tar.gz: 17a12f8abf74f026571c413c3ea3ed4b58eca59895e00b0b5010778741f606acbfb971afef49ae7a1c40e8b6fde5ca8e90349f5a4f5ebbf5981ad9672de25e22
|
data/embulk-plugin-redis.gemspec
CHANGED
data/lib/embulk/output/redis.rb
CHANGED
@@ -13,6 +13,7 @@ module Embulk
|
|
13
13
|
'key' => config.param('key', :string),
|
14
14
|
'url' => config.param('url', :string),
|
15
15
|
'is_json' => config.param('is_json', :bool, :default => false),
|
16
|
+
'expire' => config.param('expire', :integer, :default => -1),
|
16
17
|
}
|
17
18
|
|
18
19
|
puts "Redis output started."
|
@@ -45,9 +46,16 @@ module Embulk
|
|
45
46
|
# If the data being stored is known to be JSON.
|
46
47
|
if task['is_json']
|
47
48
|
@redis.set(record[0][task['key']], record[0].to_json)
|
49
|
+
if task['expire'] > -1
|
50
|
+
@redis.expire(record[0][task['key']], task['expire'])
|
51
|
+
end
|
48
52
|
else
|
49
53
|
@redis.set(hash[task['key']], hash)
|
54
|
+
if task['expire'] > -1
|
55
|
+
@redis.expire(hash[task['key']], task['expire'])
|
56
|
+
end
|
50
57
|
end
|
58
|
+
|
51
59
|
@records += 1
|
52
60
|
end
|
53
61
|
end
|