Skip to content

Commit

Permalink
add slack notifications on error
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Feb 3, 2024
1 parent 2a07161 commit c65453c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ gem 'puma', '~> 5.0'
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'

gem 'ruby_notifications_client', git: 'https://github.com/codelittinc/ruby_notifications_client.git'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
GIT
remote: https://github.com/codelittinc/ruby_notifications_client.git
revision: c5cc3748708ae1bcc23f53dfe33ec467646b4068
specs:
ruby_notifications_client (0.1.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -326,6 +332,7 @@ DEPENDENCIES
rubocop
rubocop-factory_bot
rubocop-rails
ruby_notifications_client!
sassc-rails
shoulda-matchers
sidekiq
Expand Down
8 changes: 8 additions & 0 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) if File.exist?(schedule_file)
end

# config.error_handlers << proc do |ex, ctx_hash, _cfg|
# job = ctx_hash[:job]['class']
# args = ctx_hash[:job]['args']
#
# message = "There was an error with the job: #{job} with arguments: #{args.join(',')}.\nThe error message is: #{ex}"
# RubyNotificationsClient::Channel.new.send(message, ENV.fetch('ERROR_NOTIFICATION_CHANNEL', nil))
# end
end

Sidekiq.configure_client do |config|
Expand Down

0 comments on commit c65453c

Please sign in to comment.