ruby_event_store-outbox 0.0.3 → 0.0.4

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: 89f971d2c4366655940f73a71fd28822d7b07351b3365b8b7fcef56c1f667c38
4
- data.tar.gz: 4cf6356f1b559d277b5ef17a39ef4158eea7e6e35ec2eba0705e985fd1555c56
3
+ metadata.gz: db60ea5281225f61b150abd5c7e6cc8e7379f09f20c58ed5f10b234534e43612
4
+ data.tar.gz: 6a4d1015845ce306d2d9663d3b70fe284fa75ea783960e3c345d5d315d79cc61
5
5
  SHA512:
6
- metadata.gz: f25f09627e62a3a856709c8dd331b43d48ca8d7001690704e91de7d488291765f013986785131fd8bb24c383b2cd207802a4b34f960d09375287388c27ddd29b
7
- data.tar.gz: 788200eaba625da46a762304071fe6a24699f23cc6da179069672afbb7ad1ab57e22c391308ca04e90e21a872b5b373abdb83d188c797cb8bd6463c513788171
6
+ metadata.gz: f3629cebca8b80cf62979c5a1cdcb27e53c63552cbdc73e3b0296d8a4fed1b2715e9a8de5f2eafa69fd3f68a3cb2b77aa2e6209be26f3fa724fc70a59575031a
7
+ data.tar.gz: 52d9e07cad234988c58453a700fe80a9325e22d68265821afd66ced82d2cbae27d2e0ab0d22b14b761a9faf908e49e766dedb99eca82aa825712e3362b5181a6
@@ -44,7 +44,7 @@ module RubyEventStore
44
44
  Record.transaction do
45
45
  records_scope = Record.lock.where(format: message_format, enqueued_at: nil)
46
46
  records_scope = records_scope.where(split_key: split_keys) if !split_keys.nil?
47
- records = records_scope.order("id ASC").limit(100)
47
+ records = records_scope.order("id ASC").limit(100).to_a
48
48
  return false if records.empty?
49
49
 
50
50
  now = @clock.now.utc
@@ -58,12 +58,7 @@ module RubyEventStore
58
58
  end
59
59
  end
60
60
 
61
- update_scope = if failed_record_ids.empty?
62
- records
63
- else
64
- records.where("id NOT IN (?)", failed_record_ids)
65
- end
66
- update_scope.update_all(enqueued_at: now)
61
+ Record.where(id: records.map(&:id) - failed_record_ids).update_all(enqueued_at: now)
67
62
 
68
63
  logger.info "Sent #{records.size} messages from outbox table"
69
64
  return true
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyEventStore
4
4
  module Outbox
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_event_store-outbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency