Skip to content

Commit e30f236

Browse files
committed
Remove sentry-rails' SendEventJob
1 parent bbf137a commit e30f236

File tree

4 files changed

+1
-187
lines changed

4 files changed

+1
-187
lines changed

sentry-rails/app/jobs/sentry/send_event_job.rb

-34
This file was deleted.

sentry-rails/lib/sentry/rails/active_job.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ def record(job, &block)
2323
Sentry.with_scope do |scope|
2424
begin
2525
scope.set_transaction_name(job.class.name, source: :task)
26-
transaction =
27-
if job.is_a?(::Sentry::SendEventJob)
28-
nil
29-
else
30-
Sentry.start_transaction(name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME)
31-
end
26+
transaction = Sentry.start_transaction(name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME)
3227

3328
scope.set_span(transaction) if transaction
3429

sentry-rails/spec/sentry/rails/activejob_spec.rb

-44
Original file line numberDiff line numberDiff line change
@@ -219,50 +219,6 @@ def perform
219219
event = transport.events.last.to_json_compatible
220220
expect(event.dig("exception", "values", 0, "type")).to eq("ZeroDivisionError")
221221
end
222-
223-
context "and in user-defined reporting job too" do
224-
before do
225-
Sentry.configuration.async = lambda do |event, hint|
226-
UserDefinedReportingJob.perform_now(event, hint)
227-
end
228-
end
229-
230-
class UserDefinedReportingJob < ActiveJob::Base
231-
def perform(event, hint)
232-
Post.find(0)
233-
rescue
234-
raise ActiveJob::DeserializationError
235-
end
236-
end
237-
238-
it "doesn't cause infinite loop because of excluded exceptions" do
239-
expect do
240-
DeserializationErrorJob.perform_now
241-
end.to raise_error(ActiveJob::DeserializationError, /divided by 0/)
242-
end
243-
end
244-
245-
context "and in customized SentryJob too" do
246-
before do
247-
class CustomSentryJob < ::Sentry::SendEventJob
248-
def perform(event, hint)
249-
raise "Not excluded exception"
250-
rescue
251-
raise ActiveJob::DeserializationError
252-
end
253-
end
254-
255-
Sentry.configuration.async = lambda do |event, hint|
256-
CustomSentryJob.perform_now(event, hint)
257-
end
258-
end
259-
260-
it "doesn't cause infinite loop" do
261-
expect do
262-
DeserializationErrorJob.perform_now
263-
end.to raise_error(ActiveJob::DeserializationError, /divided by 0/)
264-
end
265-
end
266222
end
267223

268224
context 'using rescue_from' do

sentry-rails/spec/sentry/send_event_job_spec.rb

-103
This file was deleted.

0 commit comments

Comments
 (0)