@@ -17,40 +17,40 @@ defmodule Gmail.HTTP do
1717
1818 def execute ( { :get , url , path } , % { access_token: access_token } ) do
1919 ( url <> path )
20- |> HTTPoison . get ( get_headers ( access_token ) )
20+ |> HTTPoison . get ( get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
2121 |> do_parse_response
2222 end
2323
2424 def execute ( { :post , url , path , data } , % { access_token: access_token } ) do
2525 { :ok , json } = encode ( data )
2626 ( url <> path )
27- |> HTTPoison . post ( json , get_headers ( access_token ) )
27+ |> HTTPoison . post ( json , get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
2828 |> do_parse_response
2929 end
3030
3131 def execute ( { :post , url , path } , % { access_token: access_token } ) do
3232 ( url <> path )
33- |> HTTPoison . post ( "" , get_headers ( access_token ) )
33+ |> HTTPoison . post ( "" , get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
3434 |> do_parse_response
3535 end
3636
3737 def execute ( { :delete , url , path } , % { access_token: access_token } ) do
3838 ( url <> path )
39- |> HTTPoison . delete ( get_headers ( access_token ) )
39+ |> HTTPoison . delete ( get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
4040 |> do_parse_response
4141 end
4242
4343 def execute ( { :put , url , path , data } , % { access_token: access_token } ) do
4444 { :ok , json } = encode ( data )
4545 ( url <> path )
46- |> HTTPoison . put ( json , get_headers ( access_token ) )
46+ |> HTTPoison . put ( json , get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
4747 |> do_parse_response
4848 end
4949
5050 def execute ( { :patch , url , path , data } , % { access_token: access_token } ) do
5151 { :ok , json } = encode ( data )
5252 ( url <> path )
53- |> HTTPoison . patch ( json , get_headers ( access_token ) )
53+ |> HTTPoison . patch ( json , get_headers ( access_token ) , timeout: :infinity , recv_timeout: :infinity )
5454 |> do_parse_response
5555 end
5656
@@ -67,8 +67,8 @@ defmodule Gmail.HTTP do
6767 :ok
6868 end
6969
70- defp do_parse_response ( { :error , % HTTPoison.Error { id: id , reason: reason } } ) do
71- { :error , reason }
70+ defp do_parse_response ( { :error , % HTTPoison.Error { reason: reason } } ) do
71+ { :error , reason }
7272 end
7373
7474 @ spec get_headers ( String . t ) :: [ { String . t , String . t } ]
0 commit comments