notifiable-rails 0.14.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac1955221077e2eb721c85070c474b59d7952fed
4
- data.tar.gz: 8e44901e4d2f65d951b2e22e5e0bedea3ed66a97
3
+ metadata.gz: 1568aa8b106822a5c8d0457880a359cc8520d36b
4
+ data.tar.gz: 1ff305b880ca795e9a0d27e6df9c1f114ade6323
5
5
  SHA512:
6
- metadata.gz: 33fe7d0abb351f211c697f5a060265755dee45b029d987b0d7621c2a39c7d8471946099e6f4760715b4bcd861fdc020f077c8f1c2087b72243630e0c5d38272f
7
- data.tar.gz: f290d6d0a398447e5d348ac36ab74c1ee2ee0fe073edeb45ba7703ad59e379009f6df2e789a77003c81d4b877f7c14c3cbf7078934053ba35676521c247c7148
6
+ metadata.gz: 31981dadd92116a72679a5fc620c63297843719cdd333f074be5d85e028d29f14bcff265b3d79271da2fb664c4f313cd3625cb37ee9fc24c0f56b033212604ee
7
+ data.tar.gz: f80118b0e079041e81ba32882f9913b14806e00326fb9d468d09b233c9011dfa83a5dc36c2eafb366842f391c58acd003cdf831b7453d3bd18e19b53f95c8f8a
@@ -10,6 +10,11 @@ Notifiable.configure do |config|
10
10
  # The class representing the holder of the device
11
11
  config.user_class = User
12
12
 
13
+ # The size of the batch of Notification Statuses kept in memory
14
+ # before being saved. This should be varied with the heap size of the process
15
+ # sending the notifications. Defaults to 10,000.
16
+ #config.notification_status_batch_size = 10000
17
+
13
18
  # Set the delivery method to test, preventing notifications from being sent
14
19
  # Defaults to :send
15
20
  #config.delivery_method = :test
data/lib/notifiable.rb CHANGED
@@ -21,6 +21,9 @@ module Notifiable
21
21
  mattr_accessor :delivery_method
22
22
  @@delivery_method = :send
23
23
 
24
+ mattr_accessor :notification_status_batch_size
25
+ @@status_batch_size = 10000
26
+
24
27
  mattr_accessor :notifier_classes
25
28
  @@notifier_classes = {}
26
29
 
@@ -23,7 +23,7 @@ module Notifiable
23
23
  def processed(notification, device_token, status)
24
24
  receipts << {notification_id: notification.id, device_token_id: device_token.id, status: status, created_at: DateTime.now}
25
25
 
26
- if receipts.count > 10000
26
+ if receipts.count > Notifiable.notification_status_batch_size
27
27
  save_receipts
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Notifiable
2
- VERSION = "0.14.0"
2
+ VERSION = "0.14.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifiable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Kocemba