Ajout de Sidekiq pour traiter les queues

This commit is contained in:
Jérémy Lecour 2020-12-31 11:53:57 +01:00
parent 9f86e66b7c
commit 18d7316f1d
5 changed files with 26 additions and 0 deletions

View file

@ -28,6 +28,7 @@ gem 'jbuilder', '~> 2.7'
gem 'elasticsearch-persistence'
gem 'elasticsearch-rails'
gem 'sidekiq'
# gem 'dry-types'
gem 'dry-struct'

View file

@ -78,6 +78,7 @@ GEM
childprocess (3.0.0)
coderay (1.1.3)
concurrent-ruby (1.1.7)
connection_pool (2.2.3)
crass (1.0.6)
dry-configurable (0.11.6)
concurrent-ruby (~> 1.0)
@ -200,6 +201,7 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.2.5)
regexp_parser (1.8.2)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
@ -216,6 +218,10 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sidekiq (6.1.2)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
@ -272,6 +278,7 @@ DEPENDENCIES
rails (~> 6.1.0)
sass-rails (>= 6)
selenium-webdriver
sidekiq
spring
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.4)

View file

@ -12,6 +12,8 @@ module Evobal
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.active_job.queue_adapter = :sidekiq
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading

View file

@ -1,4 +1,7 @@
require 'sidekiq/web'
Rails.application.routes.draw do
resources :emails
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
mount Sidekiq::Web => '/sidekiq'
end

13
config/sidekiq.yml Normal file
View file

@ -0,0 +1,13 @@
---
:concurrency: 2
staging:
:concurrency: 10
production:
:concurrency: 20
:queues:
- default
- mailers
- action_mailbox_routing
- active_storage_analysis
- action_mailbox_incineration