outboxable 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -6
- data/Gemfile.lock +7 -7
- data/lib/outboxable/polling_publisher_worker.rb +1 -1
- data/lib/outboxable/rabbitmq/publisher.rb +0 -1
- data/lib/outboxable/version.rb +1 -1
- data/lib/templates/outbox.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d39adee0b6d113feae798b6fd6a132e907ed882783d46d47b6b6fc658342f3
|
4
|
+
data.tar.gz: 0b40c93e184d69c2ed91a549c69e98b4e842f82f1458539e28e94bafa78e2f73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bfdc958c288ede25a0e009188d15724b623c7a2be6c4f4c27cde4723c3036d53d2265f39d2cb5366a71bddaff237bf3ef01ac3f11fcfd7e11efa6bfed7a5623
|
7
|
+
data.tar.gz: 69896262919b22874de8b0c0c8c34d77d9830ffae7d46f4eb59e674191932872a753632d2eb99750c3306de47784c4452a1564e7ea2da30407e7f18653b968bb
|
data/Gemfile
CHANGED
@@ -6,14 +6,11 @@ source 'https://rubygems.org'
|
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
gem 'rake', '~> 13.0'
|
9
|
-
|
10
9
|
gem 'rspec', '~> 3.0'
|
11
|
-
|
12
10
|
gem 'rubocop-rails', '~> 2.18'
|
13
11
|
|
14
12
|
group :development, :test do
|
15
|
-
gem
|
16
|
-
gem
|
17
|
-
gem
|
13
|
+
gem 'activesupport', '~> 7.0'
|
14
|
+
gem 'sidekiq', '~> 7.0'
|
15
|
+
gem 'sidekiq-cron', '~> 1.10'
|
18
16
|
end
|
19
|
-
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
outboxable (0.1.
|
4
|
+
outboxable (0.1.4)
|
5
5
|
bunny (>= 2.19.0)
|
6
6
|
connection_pool (~> 2.3.0)
|
7
7
|
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
json (2.6.3)
|
34
34
|
minitest (5.18.0)
|
35
35
|
parallel (1.22.1)
|
36
|
-
parser (3.2.
|
36
|
+
parser (3.2.2.0)
|
37
37
|
ast (~> 2.4.1)
|
38
38
|
raabro (1.4.0)
|
39
39
|
rack (2.2.6.4)
|
@@ -53,21 +53,21 @@ GEM
|
|
53
53
|
rspec-expectations (3.12.2)
|
54
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
55
|
rspec-support (~> 3.12.0)
|
56
|
-
rspec-mocks (3.12.
|
56
|
+
rspec-mocks (3.12.5)
|
57
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
58
|
rspec-support (~> 3.12.0)
|
59
59
|
rspec-support (3.12.0)
|
60
|
-
rubocop (1.
|
60
|
+
rubocop (1.49.0)
|
61
61
|
json (~> 2.3)
|
62
62
|
parallel (~> 1.10)
|
63
63
|
parser (>= 3.2.0.0)
|
64
64
|
rainbow (>= 2.2.2, < 4.0)
|
65
65
|
regexp_parser (>= 1.8, < 3.0)
|
66
66
|
rexml (>= 3.2.5, < 4.0)
|
67
|
-
rubocop-ast (>= 1.
|
67
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
68
68
|
ruby-progressbar (~> 1.7)
|
69
69
|
unicode-display_width (>= 2.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
70
|
+
rubocop-ast (1.28.0)
|
71
71
|
parser (>= 3.2.1.0)
|
72
72
|
rubocop-rails (2.18.0)
|
73
73
|
activesupport (>= 4.2.0)
|
@@ -104,4 +104,4 @@ DEPENDENCIES
|
|
104
104
|
sidekiq-cron (~> 1.10)
|
105
105
|
|
106
106
|
BUNDLED WITH
|
107
|
-
2.4.
|
107
|
+
2.4.7
|
@@ -6,7 +6,7 @@ module Outboxable
|
|
6
6
|
def perform
|
7
7
|
Outbox.pending.where(last_attempted_at: [..Time.zone.now, nil]).find_in_batches(batch_size: 100).each do |batch|
|
8
8
|
batch.each do |outbox|
|
9
|
-
# This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs.
|
9
|
+
# This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs.
|
10
10
|
outbox.update(last_attempted_at: 1.minute.from_now)
|
11
11
|
Outboxable::Worker.perform_async(outbox.id)
|
12
12
|
end
|
data/lib/outboxable/version.rb
CHANGED
data/lib/templates/outbox.rb
CHANGED
@@ -10,15 +10,13 @@ class Outbox < ApplicationRecord
|
|
10
10
|
enum size: { single: 0, batch: 1 }
|
11
11
|
|
12
12
|
# Validations
|
13
|
-
validates :payload, presence: true
|
14
|
-
validates :exchange, presence: true
|
15
|
-
validates :routing_key, presence: true
|
13
|
+
validates :payload, :exchange, :routing_key, presence: true
|
16
14
|
|
17
15
|
# Associations
|
18
16
|
belongs_to :outboxable, polymorphic: true, optional: true
|
19
17
|
|
20
18
|
def set_last_attempted_at
|
21
|
-
self.last_attempted_at =
|
19
|
+
self.last_attempted_at = 10.seconds.from_now
|
22
20
|
end
|
23
21
|
|
24
22
|
def publish
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outboxable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brusk Awat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|