diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2010-01-06 17:31:14 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2010-01-06 17:31:14 +0100 |
commit | fb0cee2afb9c5932aaf5cbef10a2def594f27456 (patch) | |
tree | f516b63bb18cccad7e00abb310cd5f4df0856785 /src/rebar_config.erl | |
parent | c9d175a30d6e63d7b1c3db4a0ed0b7d3d7b706be (diff) |
Implemented option to specify number of concurrent workers a command may use
Diffstat (limited to 'src/rebar_config.erl')
-rw-r--r-- | src/rebar_config.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar_config.erl b/src/rebar_config.erl index 0ca9b41..1ccf6af 100644 --- a/src/rebar_config.erl +++ b/src/rebar_config.erl @@ -31,7 +31,7 @@ get_all/2, set/3, set_global/2, get_global/2, - is_verbose/0]). + is_verbose/0, get_jobs/0]). -include("rebar.hrl"). @@ -83,6 +83,10 @@ set(Config, Key, Value) -> Opts = proplists:delete(Key, Config#config.opts), Config#config { opts = [{Key, Value} | Opts] }. +set_global(jobs=Key, Value) when is_list(Value) -> + set_global(Key,list_to_integer(Value)); +set_global(jobs=Key, Value) when is_integer(Value) -> + application:set_env(rebar_global, Key, erlang:max(1,Value)); set_global(Key, Value) -> application:set_env(rebar_global, Key, Value). @@ -102,6 +106,8 @@ is_verbose() -> false end. +get_jobs() -> + get_global(jobs, 3). %% =================================================================== %% Internal functions |