Skip to content

Commit

Permalink
Increase recv_timeout for Trello requests
Browse files Browse the repository at this point in the history
  • Loading branch information
sixFingers committed Aug 24, 2016
1 parent 056aacb commit eab1824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/phamello/clients/trello_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule Phamello.TrelloClient do
defp do_create_attachment(%{"id" => id} = card, picture) do
response = "#{@cards_path}/#{id}#{@card_attachments_path}"
|> full_url(auth_params)
|> HTTPoison.post!(attachment_body(picture))
|> HTTPoison.post!(attachment_body(picture), [], recv_timeout: 20000)
|> parse_response

case response do
Expand All @@ -42,7 +42,7 @@ defmodule Phamello.TrelloClient do
def do_create_base_card(list_id, picture) do
@cards_path
|> full_url(card_params(list_id, picture))
|> HTTPoison.post!("")
|> HTTPoison.post!("", [], recv_timeout: 20000)
|> parse_response
end

Expand Down Expand Up @@ -70,7 +70,7 @@ defmodule Phamello.TrelloClient do
defp fetch_boards do
@boards_path
|> full_url(boards_params)
|> HTTPoison.get!
|> HTTPoison.get!([], recv_timeout: 20000)
|> parse_response
end

Expand Down
3 changes: 2 additions & 1 deletion lib/phamello/picture/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ defmodule Phamello.PictureWorker do

case Repo.update(changeset) do
{:ok, picture} ->
GenServer.cast(__MODULE__, {:browser_notify, picture})
GenServer.cast(__MODULE__, {:trello_notify_start, picture})
{:error, _changeset} ->
Logger.error "#{@s3_upload_error_message} #{picture_id}"
Expand Down Expand Up @@ -82,6 +81,8 @@ defmodule Phamello.PictureWorker do

if status == :error do
Logger.error "#{@s3_upload_error_message} #{picture_id}"
else
GenServer.cast(__MODULE__, {:browser_notify, picture})
end

{:noreply, state}
Expand Down

0 comments on commit eab1824

Please sign in to comment.