lib/tobox/plugins/sentry.rb in tobox-0.6.1 vs lib/tobox/plugins/sentry.rb in tobox-0.7.0
- old
+ new
@@ -36,19 +36,19 @@
::Sentry.clone_hub_to_current_thread
scope = ::Sentry.get_current_scope
scope.set_contexts(tobox: {
- id: event[:id],
- type: event[:type],
- attempts: event[:attempts],
- created_at: event[:created_at],
- run_at: event[:run_at],
- last_error: event[:last_error]&.byteslice(0..1000),
- version: Tobox::VERSION,
- db_adapter: @db_scheme
- })
+ id: event[:id],
+ type: event[:type],
+ @attempts_column => event[@config[:attempts_column]],
+ created_at: event[:created_at],
+ @visibility_column => event[@config[:visibility_column]],
+ last_error: event[:last_error]&.byteslice(0..1000),
+ version: Tobox::VERSION,
+ db_adapter: @db_scheme
+ }.compact)
scope.set_tags(
outbox: @db_table,
event_id: event[:id],
event_type: event[:type]
)
@@ -114,10 +114,12 @@
store.delete(event[:id])
end
def capture_exception(event, error)
- if ::Sentry.configuration.tobox.report_after_retries && event[:attempts] && event[:attempts] < @max_attempts
+ if ::Sentry.configuration.tobox.report_after_retries &&
+ event[@config[:attempts_column]] &&
+ event[@config[:attempts_column]] < @max_attempts
return
end
::Sentry.capture_exception(
error,