Merge pull request #9730 from demarches-simplifiees/polish_sidekiq
Tech: rajoute des logs, de l'audit de perf et du suivi de bug pour la file de job asynchrone sidekiq
This commit is contained in:
commit
f66a32c316
4 changed files with 15 additions and 6 deletions
1
Gemfile
1
Gemfile
|
@ -84,6 +84,7 @@ gem 'sassc-rails' # Use SCSS for stylesheets
|
||||||
gem 'sentry-delayed_job'
|
gem 'sentry-delayed_job'
|
||||||
gem 'sentry-rails'
|
gem 'sentry-rails'
|
||||||
gem 'sentry-ruby'
|
gem 'sentry-ruby'
|
||||||
|
gem 'sentry-sidekiq'
|
||||||
gem 'sib-api-v3-sdk'
|
gem 'sib-api-v3-sdk'
|
||||||
gem 'sidekiq'
|
gem 'sidekiq'
|
||||||
gem 'skylight'
|
gem 'skylight'
|
||||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -397,7 +397,7 @@ GEM
|
||||||
railties (>= 4)
|
railties (>= 4)
|
||||||
request_store (~> 1.0)
|
request_store (~> 1.0)
|
||||||
logstash-event (1.2.02)
|
logstash-event (1.2.02)
|
||||||
loofah (2.21.4)
|
loofah (2.22.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.12.0)
|
nokogiri (>= 1.12.0)
|
||||||
mail (2.8.1)
|
mail (2.8.1)
|
||||||
|
@ -444,7 +444,7 @@ GEM
|
||||||
net-protocol
|
net-protocol
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
nio4r (2.5.9)
|
nio4r (2.5.9)
|
||||||
nokogiri (1.15.4)
|
nokogiri (1.15.5)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
|
@ -497,7 +497,7 @@ GEM
|
||||||
pundit (2.2.0)
|
pundit (2.2.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.4.0)
|
raabro (1.4.0)
|
||||||
racc (1.7.1)
|
racc (1.7.3)
|
||||||
rack (2.2.8)
|
rack (2.2.8)
|
||||||
rack-attack (6.5.0)
|
rack-attack (6.5.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
|
@ -559,7 +559,7 @@ GEM
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
zeitwerk (~> 2.5)
|
zeitwerk (~> 2.5)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.0.6)
|
rake (13.1.0)
|
||||||
rake-progressbar (0.0.5)
|
rake-progressbar (0.0.5)
|
||||||
rb-fsevent (0.11.2)
|
rb-fsevent (0.11.2)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
|
@ -682,6 +682,9 @@ GEM
|
||||||
sentry-ruby (~> 5.9.0)
|
sentry-ruby (~> 5.9.0)
|
||||||
sentry-ruby (5.9.0)
|
sentry-ruby (5.9.0)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
|
sentry-sidekiq (5.9.0)
|
||||||
|
sentry-ruby (~> 5.9.0)
|
||||||
|
sidekiq (>= 3.0)
|
||||||
shoulda-matchers (4.5.1)
|
shoulda-matchers (4.5.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
sib-api-v3-sdk (7.4.0)
|
sib-api-v3-sdk (7.4.0)
|
||||||
|
@ -921,6 +924,7 @@ DEPENDENCIES
|
||||||
sentry-delayed_job
|
sentry-delayed_job
|
||||||
sentry-rails
|
sentry-rails
|
||||||
sentry-ruby
|
sentry-ruby
|
||||||
|
sentry-sidekiq
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
sib-api-v3-sdk
|
sib-api-v3-sdk
|
||||||
sidekiq
|
sidekiq
|
||||||
|
|
|
@ -2,7 +2,11 @@ class SidekiqAgainJob < ApplicationJob
|
||||||
self.queue_adapter = :sidekiq
|
self.queue_adapter = :sidekiq
|
||||||
queue_as :default
|
queue_as :default
|
||||||
|
|
||||||
def perform(user)
|
def perform(user, with_exception: false)
|
||||||
|
if with_exception
|
||||||
|
raise 'Nop'
|
||||||
|
end
|
||||||
|
Sentry.capture_message('this is a message from sidekiq')
|
||||||
UserMailer.new_account_warning(user).deliver_now
|
UserMailer.new_account_warning(user).deliver_now
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -80,7 +80,7 @@ module TPS
|
||||||
|
|
||||||
config.ds_zonage_enabled = ENV.fetch("ZONAGE_ENABLED", nil) == "enabled"
|
config.ds_zonage_enabled = ENV.fetch("ZONAGE_ENABLED", nil) == "enabled"
|
||||||
|
|
||||||
config.skylight.probes += [:graphql]
|
config.skylight.probes += [:graphql, :active_job]
|
||||||
|
|
||||||
# Custom Configuration
|
# Custom Configuration
|
||||||
# @see https://guides.rubyonrails.org/configuring.html#custom-configuration
|
# @see https://guides.rubyonrails.org/configuring.html#custom-configuration
|
||||||
|
|
Loading…
Add table
Reference in a new issue