Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make rake task not error in prod #5509

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,34 @@ namespace :after_party do
puts "Running deploy task 'set_case_contacts_as_active'"

CaseContact.all.each do |cc|
cc.update!(status: "active", draft_case_ids: [cc.casa_case_id])
begin
cc.update!(status: "active", draft_case_ids: [cc.casa_case_id])
rescue => e
begin
require 'bugsnag'
Bugsnag.configure do |config|
config.api_key = ENV["BUGSNAG_API_KEY"]
config.ignore_classes << ActiveRecord::RecordNotFound
config.release_stage = ENV["HEROKU_APP_NAME"] || ENV["APP_ENVIRONMENT"]

callback = proc do |event|
event.set_user(current_user&.id, current_user&.email)
end

config.add_on_error(callback)
end

Bugsnag.notify(e)
rescue => e2
p e2
end
p e
end
end

# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end
Loading