safwank / ElixirRetry

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Other
441 stars 32 forks source link

Wrong syntax error #35

Closed alex88 closed 5 years ago

alex88 commented 5 years ago

Hi there, I've this syntax:

  defp make_request(url, params) do
    params = Keyword.merge([
      p: "LAST_HOUR-12",
    ], params)
    |> URI.encode_query()
    retry with: exponential_backoff() |> expiry(120_000), rescue_only: [TimeoutError] do
      .....
    end
  end

and I'm getting

== Compilation error in file lib/.../poller.ex ==
** (ArgumentError) invalid syntax, only "retry", "after" and "else" are permitted
    expanding macro: Retry.retry/2
    lib/..../poller.ex:58: ...Poller.make_request/2
    (elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

however I don't see what can be wrong with it, I've tried to wrap the with: between parenthesis and other small changes but nothing changes

alex88 commented 5 years ago

Nvm checking out again the repo fixed it (even if I had tried already after deleting _build and deps) 🤷‍♂

joevandyk commented 4 years ago

I'm getting this as well with elixir 1.10.2 and retry 0.13