inboxable 0.1.0 → 0.1.1
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/CHANGELOG.md +1 -1
- data/lib/inboxable/configuration.rb +5 -1
- data/lib/inboxable/polling_receiver_worker.rb +2 -2
- data/lib/inboxable/version.rb +1 -1
- data/lib/inboxable.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f796060bcb2461754d9c77a51ca4b5dfa638d3e5235af50be6ed58195187bd6
|
4
|
+
data.tar.gz: 8671ce2b6c55b7d1060466de3280ec066e407f5bd2c8fc617ee83c104034237d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a63084c541d6da7d74c3b8fbfa8277574c7931d713dd4591cdc4043034391ed96eb51fa4b0a090c4e3bb551bc5e2d6b6c5b045f86e5af8d735b4dc2874d5c9b
|
7
|
+
data.tar.gz: ed83bb53ec33b7f8d32052c7216c8b3cf9573f9a373a709704fef6a214eca03fa5bd000bb802bb476d547fbffe274694e7ed3b02f24f13f382e32b093f225741
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,7 @@ module Inboxable
|
|
2
2
|
class Configuration
|
3
3
|
ALLOWED_ORMS = %i[activerecord mongoid].freeze
|
4
4
|
|
5
|
-
attr_accessor :orm
|
5
|
+
attr_accessor :orm, :inbox_model
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
raise Error, 'Sidekiq is not available. Unfortunately, sidekiq must be available for Inboxable to work' unless Object.const_defined?('Sidekiq')
|
@@ -23,5 +23,9 @@ module Inboxable
|
|
23
23
|
def orm
|
24
24
|
@orm || :activerecord
|
25
25
|
end
|
26
|
+
|
27
|
+
def inbox_model
|
28
|
+
@inbox_model || 'Inbox'
|
29
|
+
end
|
26
30
|
end
|
27
31
|
end
|
@@ -9,7 +9,7 @@ module Inboxable
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def perform_activerecord
|
12
|
-
|
12
|
+
Inboxable.inbox_model.pending
|
13
13
|
.where(last_attempted_at: [..Time.zone.now, nil])
|
14
14
|
.find_in_batches(batch_size: ENV.fetch('INBOXABLE__BATCH_SIZE', 100).to_i)
|
15
15
|
.each do |batch|
|
@@ -22,7 +22,7 @@ module Inboxable
|
|
22
22
|
|
23
23
|
def perform_mongoid
|
24
24
|
batch_size = ENV.fetch('INBOXABLE__BATCH_SIZE', 100).to_i
|
25
|
-
|
25
|
+
Inboxable.inbox_model.pending
|
26
26
|
.any_of({ last_attempted_at: ..Time.zone.now }, { last_attempted_at: nil })
|
27
27
|
.each_slice(batch_size) do |batch|
|
28
28
|
batch.each do |inbox|
|
data/lib/inboxable/version.rb
CHANGED
data/lib/inboxable.rb
CHANGED