totoro 0.5.0 → 0.5.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
  SHA256:
3
- metadata.gz: 0e835b3b9956681b140dde6f1a471349612cb863e2744e7a292d0505df22ed25
4
- data.tar.gz: 10226f19be041d051c9c9a7ff091ac147508cc32a974cb7869bb7ffce0615cb0
3
+ metadata.gz: 887b647ac10b4602521547775e3450f3e494e49485c7ff6561c40254c4ee70cf
4
+ data.tar.gz: 01c4d423e603bc23493af121bfdbaa0417d45742888d66e731dab9a46fe12281
5
5
  SHA512:
6
- metadata.gz: 563b7abfd127453918a2f56c40131415bdb14829463f92ffd41d78cef823985a43f32678991d6f0d9b8ab61d45c332037b05776157aa549313031234c28988cf
7
- data.tar.gz: 3620dedf09672a6560c9b40415431a3b23b4e06bc574792b7cf7dc2f2088f47dd56a09e860d590f6d4a64b03920c2dac74e472857d80340d9904a2b303805dd0
6
+ metadata.gz: ccedd69d1b6bd85bedc5176582fac0a113dd9353038a33f9a110b0d612e6fd5c3f050ed96bd70cadb83e07dbda414fed762e5b7c60e28e9662c0303af4679f6e
7
+ data.tar.gz: 3039126bb7eb21598857427d0e3f388d826f163ef40113bc3cd1a2ede2b46e726756d18164c35e3050f7124c91421b1a8e8810f44d6cd040a5f88233b6d374fc
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # Totoro, a RabbitMQ Util
2
2
 
3
3
  Totoro is a RabbitMQ util that focuses on samplify queue operation.
4
-
4
+ ## Dependencies
5
+ Please install [Delayed Job active record](https://rubygems.org/gems/delayed_job_active_record) and [Delayed Job recurring](https://rubygems.org/gems/delayed_job_recurring) before use Totoro.
6
+ Totoro basically use delayed job to cache and resend falied messages.
5
7
  ## Installation
6
8
 
7
9
  ### Install gem
@@ -24,9 +26,17 @@ This command will generate two files
24
26
 
25
27
  1. `totoro.yml` (Rabbitmq configuration file)
26
28
  2. `initilizers/totoro.rb` (Rails initializer)
29
+ 3. `db/migrate/[tiemstamp]_create_totoro_failed_messages.rb` (DB migration to create messages caching table)
30
+
31
+ #### Run DB migraion
32
+ `rake db:migrate`
27
33
 
28
34
  ## Quick Start
29
35
 
36
+ ### Resend Failed messages daemon
37
+
38
+ Please run `rake totoro:resend_msg` before you start your app.
39
+
30
40
  ### Default rabbitmq server
31
41
 
32
42
  #### Enqueue
@@ -9,9 +9,11 @@ module Totoro
9
9
  queue 'totoro'
10
10
  def perform
11
11
  Totoro::Queue.connection
12
- Totoro::TotoroFailedMessage.all.each do |m|
13
- m.class_name.constantize.enqueue(m.queue_id, m.payload)
14
- m.destroy
12
+ Totoro::TotoroFailedMessage.find_in_batches(batch_size: 100) do |message_group|
13
+ message_group.each do |m|
14
+ m.class_name.constantize.enqueue(m.queue_id, m.payload)
15
+ m.destroy
16
+ end
15
17
  end
16
18
  rescue Bunny::TCPConnectionFailedForAllHosts => error
17
19
  Rails.logger.error error.message
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Totoro
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShuHui18
@@ -131,6 +131,7 @@ files:
131
131
  - lib/totoro/tasks/resend_message.rake
132
132
  - lib/totoro/totoro_failed_message.rb
133
133
  - lib/totoro/version.rb
134
+ - pkg/totoro-0.5.0.gem
134
135
  - spec/spec_helper.rb
135
136
  - spec/totoro_spec.rb
136
137
  - test/totoro_test/Gemfile