alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Do not apply subsequent updates if one failed. #68

Closed saulius closed 11 years ago

saulius commented 11 years ago

Sequel::Rollback gets caught by Sequel.transaction block so all subsequent updates were applied. Now we just mark update as failed and re-raise the exception to end the process.

Apply task won't run and will send an error message if there are any failed updates, see https://github.com/alphagov/trade-tariff-backend/blob/cd87056e7a0216560a3eec6497c8faace15f65c5/lib/tariff_synchronizer.rb#L105.