Skip to content

Instantly share code, notes, and snippets.

@AndrewDryga
Last active June 3, 2018 17:41
Show Gist options
  • Save AndrewDryga/74ee583e2802acf45b25e7990b377b77 to your computer and use it in GitHub Desktop.
Save AndrewDryga/74ee583e2802acf45b25e7990b377b77 to your computer and use it in GitHub Desktop.
Sage: Stage with Circuit Breaker
def currency_exchange_rates_circuit_breaker(_effect_to_compensate, _effects_so_far, %{"base_currency" => base_currency}) do
with {:ok, exchange_rates} <- BookingApp.Cache.fetch(:eur_exchange_rates, base_currency) do
{:continue, exchange_rates}
else
_ -> :ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment