Skip to content

Commit

Permalink
Increate requests timeouts in agner_server public API
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Feb 8, 2011
1 parent ac15a3d commit 376e447
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/agner_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

-define(SERVER, ?MODULE).

-define(TIMEOUT, 60000).

-record(state, {
}).
Expand All @@ -39,21 +40,21 @@ start_link() ->
-spec spec(agner_package_name(), agner_package_version()) -> agner_spec().

spec(Name, Version) ->
gen_server:call(?SERVER, {spec, Name, Version}).
gen_server:call(?SERVER, {spec, Name, Version}, ?TIMEOUT).

%% @doc Ask the server for a spec URL
%% @end
-spec spec_url(agner_package_name(), agner_package_version()) -> url().

spec_url(Name, Version) ->
gen_server:call(?SERVER, {spec_url, Name, Version}).
gen_server:call(?SERVER, {spec_url, Name, Version}, ?TIMEOUT).

%% @doc Ask the server for an index
%% @end
-spec index() -> list(agner_package_name()).

index() ->
gen_server:call(?SERVER, index).
gen_server:call(?SERVER, index, infinity).

%% @doc Fetch a package/project to a directory
%% @end
Expand All @@ -68,7 +69,7 @@ fetch(NameOrSpec, Version, Directory) ->
-spec versions(agner_package_name()) -> list(agner_package_version()).

versions(Name) ->
gen_server:call(?SERVER, {versions, Name}).
gen_server:call(?SERVER, {versions, Name},?TIMEOUT).

%%%===================================================================
%%% gen_server callbacks
Expand Down

0 comments on commit 376e447

Please sign in to comment.