Skip to content

Commit

Permalink
Merge pull request #6721 from DFE-Digital/also-register-to-sentry-ext…
Browse files Browse the repository at this point in the history
…ernal-source-import-runs-without-errors

Report to Sentry ATS imports without errors
  • Loading branch information
scruti committed Mar 8, 2024
2 parents 182c4f2 + af2bc7b commit 4c14df6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/jobs/import_from_vacancy_source_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ def create_failed_imported_vacancy(vacancy)
end

def report_validation_errors
return if @errors.none?
failed_percentage = @errors.any? ? ((@errors.count.to_f / @vacancies_count) * 100).round(1) : 0

failed_percentage = ((@errors.count.to_f / @vacancies_count) * 100).round(1)
Sentry.with_scope do |scope|
scope.set_tags(source: @source_name)
scope.set_context("Import failure rate", { vacancies_in_feed: @vacancies_count,
Expand Down

0 comments on commit 4c14df6

Please sign in to comment.