alephant-sequencer 0.0.5 → 0.0.6
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da4eb17201797a629eaeeac5596eeea58c0ae5ff
|
4
|
+
data.tar.gz: 1ca50a3ef5e5cb822d45d8f63cb029765d24abd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50a39c7b3faab1cf4fd590c40d55188fc1400124045a52dedad92955de88ce09fa4e4000877464675e348e75c2bc9c337e9bfea674f21a7071247ac36abdf6f
|
7
|
+
data.tar.gz: 3b3978ea477682fe6735d1f3c1c17a9f87d957e48fae08c8409230b598705eaf9fba5a5c694aa13832b72f8cd23544c8a12a6b5814f88ba7de946764d867e859
|
@@ -58,8 +58,18 @@ module Alephant
|
|
58
58
|
put_condition(last_seen_check)
|
59
59
|
)
|
60
60
|
end
|
61
|
+
|
62
|
+
logger.info("SequenceTable#set_sequence_for: #{value} for #{ident} success!")
|
61
63
|
rescue AWS::DynamoDB::Errors::ConditionalCheckFailedException => e
|
62
|
-
logger.warn("SequenceTable#set_sequence_for: #{e.message}")
|
64
|
+
logger.warn("SequenceTable#set_sequence_for: #{ident} #{e.message}")
|
65
|
+
last_seen_check = sequence_for(ident)
|
66
|
+
|
67
|
+
unless last_seen_check >= value
|
68
|
+
logger.info("SequenceTable#set_sequence_for: #{ident} trying again!")
|
69
|
+
set_sequence_for(ident, value, last_seen_check)
|
70
|
+
else
|
71
|
+
logger.warn("SequenceTable#set_sequence_for: #{ident} outdated!")
|
72
|
+
end
|
63
73
|
end
|
64
74
|
end
|
65
75
|
|
@@ -26,11 +26,13 @@ module Alephant
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def sequence(msg, &block)
|
29
|
-
last_seen_id = get_last_seen
|
30
29
|
block.call(msg)
|
31
30
|
|
32
|
-
|
31
|
+
last_seen_id = get_last_seen
|
32
|
+
if (last_seen_id || 0) < sequence_id_from(msg)
|
33
33
|
set_last_seen(msg, last_seen_id)
|
34
|
+
else
|
35
|
+
logger.info("Sequencer#sequence nonsequential message for #{ident}")
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -42,7 +44,6 @@ module Alephant
|
|
42
44
|
|
43
45
|
def set_last_seen(msg, last_seen_check = nil)
|
44
46
|
seen_id = sequence_id_from(msg)
|
45
|
-
logger.info("Sequencer#set_last_seen: #{seen_id}")
|
46
47
|
|
47
48
|
@sequence_table.set_sequence_for(
|
48
49
|
ident, seen_id,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-sequencer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Kenny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|