alephant-sequencer 3.1.0 → 3.1.1

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: 828631b0eec1400b6adbb9910b9a19e1659e018a
4
- data.tar.gz: fdc535ef2eaecd2d7b62754877bfb90e19539a21
3
+ metadata.gz: e18b0c6e698768dce4f614890d9ce4bef61f0cb7
4
+ data.tar.gz: c644ddf1987bef172626151badd5834c2d0af925
5
5
  SHA512:
6
- metadata.gz: b5f00a88470c386b18f7c9e70a3a64420151118eea6519a39735375e897c933b1847f3ee5977e364c1f282c2bd925c959b5bf77765e76c09d0fa3c36698f0ef0
7
- data.tar.gz: 126c68d4bac4a810677c84876908b779022f88a7f86940d35f82fa17c260d0de4703c0221b042c40b2658d176b71d63e749fb87a7057e584c882f5dcddfb0bd8
6
+ metadata.gz: 7972baac0d4095ab9e5add8bee3ead2ccbc733003d179cf1246a72efe622e436c8f3aafb5ee71a886e3ac46f69f94de1741e1386b63cdc24ca3a1efbfbdc6c8f
7
+ data.tar.gz: 3531b8a5734af6f6d49cce71c401e28168537359383e76901ec08d31ddf1394c3c7094d07e6e15766a30c9623c4720a3cffd842ba28682b26af7695f0a95c1d1
@@ -39,21 +39,18 @@ module Alephant
39
39
  current_sequence = last_seen_check.nil? ? sequence_for(ident) : last_seen_check
40
40
 
41
41
  dynamo_response = @mutex.synchronize do
42
- client.put_item(table_name: table_name,
43
- item: {
44
- 'key' => ident,
45
- 'value' => value.to_s
46
- },
47
- expected: {
48
- 'key' => {
49
- comparison_operator: 'NULL'
50
- },
51
- 'value' => {
52
- comparison_operator: 'GE',
53
- attribute_value_list: [current_sequence.to_s]
54
- }
55
- },
56
- conditional_operator: 'OR')
42
+ client.put_item(
43
+ table_name: table_name,
44
+ item: {
45
+ 'key' => ident,
46
+ 'value' => value
47
+ },
48
+ condition_expression: ':current_value < :new_value',
49
+ expression_attribute_values: {
50
+ ':current_value' => current_sequence,
51
+ ':new_value' => value
52
+ }
53
+ )
57
54
  end
58
55
 
59
56
  logger.metric('SequencerFailedConditionalChecks', value: 0)
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Sequencer
3
- VERSION = '3.1.0'.freeze
3
+ VERSION = '3.1.1'.freeze
4
4
  end
5
5
  end
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: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC News
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler