The timeout occurs when Phoenix App calls the auth api from this code
defp auth_api_call(config) do
url = "#{config["host_url"]}#{config["auth_params"]["route"]}"
headers = [{"Content-type", "application/json"}]
auth_params = config["auth_params"] |> Map.take(~w(username password))
body = Poison.encode!(auth_params)
with {:ok, %HTTPoison.Response{body: body}} <- HTTPoison.post(url, body, headers) do
body |> Poison.decode!
else
{:error, %HTTPoison.Error{reason: reason}} ->
IO.inspect reason
end
end
From Postman(API testing Extension for Chrome) I send the same params as that from the Rails app.
But the post call from HTTPoison to auth api fails in case of rails app.
So was checking for a solution to extend the timeout. Maybe something wrong with this code.
Since rails is running in development mode, it is not able to receive multiple request. Which results in timeout errors.
So the auth api calls back the rails code again, for auth data to be inserted in DB. Which creates a cycle not possible to run on single thread.