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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 469a8e0dea372c23c827c4bff24fecaed9f4c2921f4d40de8fdbed7225dbd52e
4
- data.tar.gz: 17bd59884f0a7385ae7557b76192ba08aa81e1cd9441730e71dd1bb426a9f60f
3
+ metadata.gz: a1d39adee0b6d113feae798b6fd6a132e907ed882783d46d47b6b6fc658342f3
4
+ data.tar.gz: 0b40c93e184d69c2ed91a549c69e98b4e842f82f1458539e28e94bafa78e2f73
5
5
  SHA512:
6
- metadata.gz: 1419c8437e010866124d4f3bb2edbb126475f4e9c2647f68facbb565dde6c48e2b86eb457716b16fa895d035be0f9954067b30fc79ffeebd8dcebfe275c0fa2e
7
- data.tar.gz: 747042c4e73e79cf0fc114c003f0c8a3499cfcf705f2fcdf98396d211313163048be1e42d71e5cfc2ea65ce34ccda54958eb485b191bd2957a4ff2f057457263
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 "sidekiq", "~> 7.0", require: true
16
- gem "sidekiq-cron", "~> 1.10"
17
- gem "activesupport", "~> 7.0"
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.3)
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.1.0)
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.3)
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.48.0)
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.26.0, < 2.0)
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.27.0)
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.2
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
@@ -29,7 +29,6 @@ module Outboxable
29
29
  return unless confirmed
30
30
 
31
31
  @resource.reload
32
- @resource.increment_attempt
33
32
  @resource.update(status: :published, retry_at: nil)
34
33
  end
35
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Outboxable
4
- VERSION = "0.1.3"
4
+ VERSION = '0.1.4'
5
5
  end
@@ -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 = Time.zone.now
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.3
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-05 00:00:00.000000000 Z
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny