Skip to content

Instantly share code, notes, and snippets.

@AndrewDryga
Last active May 28, 2018 15:51
Show Gist options
  • Save AndrewDryga/7d86fe0868a264a52b27fe0fcde28304 to your computer and use it in GitHub Desktop.
Save AndrewDryga/7d86fe0868a264a52b27fe0fcde28304 to your computer and use it in GitHub Desktop.
Sage: Stage with Retry in Compensation
def delete_subscription(_effect_to_compensate, %{user: user}, _name_and_reason, _attrs) do
:ok = SageExample.Billing.APIClient.delete_all_subscriptions_for_user(user)
# We want to apply forward recovery from :subscription stage for 5 times
{:retry, retry_limit: 5, base_backoff: 10, max_backoff: 30_000, enable_jitter: true}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment