Skip to content

Commit

Permalink
Remove useless slack message and skip (#2097)
Browse files Browse the repository at this point in the history
* Remove slack message

* Don't queue up things that won't succeed
  • Loading branch information
Cory McDonald authored Aug 5, 2019
1 parent 87b78dd commit 100081b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/jobs/create_uphold_cards_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def perform(uphold_connection_id:)
uphold_connection = UpholdConnection.find(uphold_connection_id)
unless uphold_connection.can_create_uphold_cards?
Rails.logger.info("Could not create uphold card for publisher #{uphold_connection.publisher_id}. Uphold Verified: #{uphold_connection.uphold_verified}")
SlackMessenger.new(message: "Could not create uphold card for publisher #{uphold_connection.publisher_id}.", channel: SlackMessenger::ALERTS).perform
return
end

Expand Down
5 changes: 4 additions & 1 deletion app/jobs/migrate_uphold_access_parameters_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def perform(publisher_id:, parameters:, default_currency:)
default_currency_confirmed_at: connection.publisher.default_currency_confirmed_at || Time.now
)

connection.sync_from_uphold!
was_successful = connection.sync_from_uphold!
# Let's not queue up a job that will ultimately not work due to invalid access_parameters
next unless was_successful

connection.reload

# Sync the uphold card or create it if the card is missing
Expand Down

0 comments on commit 100081b

Please sign in to comment.