Skip to content

Commit

Permalink
Merge pull request #8 from upmaru/feature/adjust-timeouts-for-lexdee-…
Browse files Browse the repository at this point in the history
…observer

Allow passing in timeout for connect call
  • Loading branch information
zacksiri authored Nov 28, 2024
2 parents 6452310 + 0eb816c commit 5be36ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/lexdee/observer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ defmodule Lexdee.Observer do
GenServer.call(pid, :connect)
end

def connect(supervisor, pid) when is_pid(pid) do
def connect(supervisor, pid, timeout \\ 30_000) when is_pid(pid) do
node = which_node(pid)

{supervisor, node}
|> Task.Supervisor.async_nolink(fn ->
GenServer.call(pid, :connect)
GenServer.call(pid, :connect, timeout + 5_000)
end)
|> Task.await()
|> Task.await(timeout + 10_000)
end

def start_link(options) do
Expand Down

0 comments on commit 5be36ff

Please sign in to comment.