Add RavenJob
This commit is contained in:
parent
6bd153f46d
commit
32ce4cc2df
3 changed files with 17 additions and 0 deletions
9
app/jobs/raven_job.rb
Normal file
9
app/jobs/raven_job.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class RavenJob < ApplicationJob
|
||||||
|
queue_as :default
|
||||||
|
|
||||||
|
def perform(event)
|
||||||
|
Raven.send_event event
|
||||||
|
end
|
||||||
|
end
|
|
@ -3,6 +3,7 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
Raven.configure do |config|
|
Raven.configure do |config|
|
||||||
|
config.async = RavenJob.method :perform_later
|
||||||
config.current_environment = Rails.env
|
config.current_environment = Rails.env
|
||||||
config.dsn = Rails.application.credentials.raven_dsn
|
config.dsn = Rails.application.credentials.raven_dsn
|
||||||
config.environments = %w[production]
|
config.environments = %w[production]
|
||||||
|
|
7
spec/jobs/raven_job_spec.rb
Normal file
7
spec/jobs/raven_job_spec.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe RavenJob do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Reference in a new issue