salesforce_streamer 0.2.3 → 0.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e5279cbf060a7998dda26f5b8243f4f7f45a235df437b6e5b43dded0a0db770
|
4
|
+
data.tar.gz: fe42569934ea906d2a90426367233918558abf2848be187263af5556ab56ae3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3f90343488c893ef58bf82ef39105acaef83283476228d7263f524ca87855dd781212cb8b107786def223c32bfea43d9f299a15bca50e95698c3b733350ad9a
|
7
|
+
data.tar.gz: 68467636cccd05ffdd5acc046b32f8f8d5dff0a14b9a72f7bcb18ac102b7664d4bb69538b5613200964f3186b596f345c1c7de83bbf1191a36df811bd825d589
|
data/Gemfile.lock
CHANGED
@@ -20,26 +20,23 @@ module SalesforceStreamer
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
# Saves the value
|
24
|
-
# The score is the ReplayId integer value
|
23
|
+
# Saves the value to a key with expiration
|
25
24
|
def record(key, value)
|
26
25
|
return unless key && value
|
27
26
|
|
28
27
|
key = namespaced_key(key)
|
29
28
|
value = Integer(value)
|
30
|
-
|
31
|
-
connection { |c| c.zadd key, value, value }
|
29
|
+
connection { |c| c.setex key, SECONDS_TO_EXPIRE, value }
|
32
30
|
rescue StandardError, TypeError => e
|
33
31
|
Configuration.instance.exception_adapter.call e
|
34
32
|
nil
|
35
33
|
end
|
36
34
|
|
37
|
-
# Retrives the highest value in the sorted set
|
38
35
|
def retrieve(key)
|
39
36
|
return unless key
|
40
37
|
|
41
38
|
key = namespaced_key(key)
|
42
|
-
value = connection { |c| c.
|
39
|
+
value = connection { |c| c.get key }
|
43
40
|
Integer(value) if value
|
44
41
|
rescue StandardError => e
|
45
42
|
Configuration.instance.exception_adapter.call e
|
@@ -53,6 +50,7 @@ module SalesforceStreamer
|
|
53
50
|
end
|
54
51
|
|
55
52
|
NAMESPACE = 'SalesforceStreamer:'
|
53
|
+
SECONDS_TO_EXPIRE = 24 * 60 * 60 # 24 hours
|
56
54
|
START = 0
|
57
55
|
STOP = 0
|
58
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce_streamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Serok
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|