diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index f95f84667..be15cc1b3 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -4,7 +4,6 @@ class FormController < ApplicationController before_action :find_resource_by_named_id, except: %i[submit_form review] def submit_form - transaction = Sentry.start_transaction(op: "submit_form") if @case_log @page = @case_log.form.get_page(params[:case_log][:page]) responses_for_page = responses_for_page(@page) @@ -24,7 +23,6 @@ class FormController < ApplicationController else render_not_found end - transaction.finish if transaction end def check_answers diff --git a/app/models/case_log.rb b/app/models/case_log.rb index a03f377fd..9df999699 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -66,10 +66,13 @@ class CaseLog < ApplicationRecord end def collection_start_year + transaction = Sentry.start_transaction(op: "collection_start_year") return unless startdate window_end_date = Time.zone.local(startdate.year, 4, 1) - startdate < window_end_date ? startdate.year - 1 : startdate.year + start_year = startdate < window_end_date ? startdate.year - 1 : startdate.year + transaction.finish if transaction + start_year end def form_name