outboxable 0.1.6 → 0.1.8
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.lock +1 -1
- data/lib/outboxable/polling_publisher_worker.rb +1 -1
- data/lib/outboxable/version.rb +1 -1
- data/lib/templates/outbox.rb +2 -1
- 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: ab43c50794ab0059ec940956619219fc78cfc1fdc2f2e21e78bd7ac5f24f43dd
|
4
|
+
data.tar.gz: 7d1f9ac4e934f92b5c257cd1489ee2f9f316998a3b60b6ba8a9d3af18b9baf41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5811e8e889c56840cff9d4911853f8929cc11b8959e204965bbfff384c7bc914a32daee6d175563921f0332419ab6201528839b548921e24d70d8428b51c23aa
|
7
|
+
data.tar.gz: 6f1b34031671e1cf047642d86a37a44e1bf26d9ec0d5a8929923a188d95177f24df264e9dfb0e8c8bf30522308325441d4a192f198daea1a063e606dd4804126
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ module Outboxable
|
|
8
8
|
batch.each do |outbox|
|
9
9
|
# This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs.
|
10
10
|
Outboxable::Worker.perform_async(outbox.id)
|
11
|
-
outbox.update(last_attempted_at: 1.minute.from_now, status: :processing)
|
11
|
+
outbox.update(last_attempted_at: 1.minute.from_now, status: :processing, allow_publish: false)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/outboxable/version.rb
CHANGED
data/lib/templates/outbox.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
class Outbox < ApplicationRecord
|
2
2
|
attribute :allow_publish, :boolean, default: true
|
3
3
|
|
4
|
+
before_save :check_publishing
|
4
5
|
# Callbacks
|
5
6
|
before_create :set_last_attempted_at
|
6
|
-
before_save :check_publishing
|
7
7
|
after_commit :publish, if: :allow_publish?
|
8
8
|
# Enums
|
9
9
|
enum status: { pending: 0, processing: 1, published: 2, failed: 3 }
|
@@ -21,6 +21,7 @@ class Outbox < ApplicationRecord
|
|
21
21
|
|
22
22
|
def publish
|
23
23
|
Outboxable::Worker.perform_async(id)
|
24
|
+
update(status: :processing, last_attempted_at: 1.minute.from_now, allow_publish: false)
|
24
25
|
end
|
25
26
|
|
26
27
|
def check_publishing
|
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.8
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|