mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Fix Dialyzer (race condition) warning
This commit is contained in:
parent
fe1652e137
commit
a176db6937
1 changed files with 5 additions and 4 deletions
|
@ -190,10 +190,11 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
|
||||||
|
|
||||||
vcs_vsn(Vcs, Dir) ->
|
vcs_vsn(Vcs, Dir) ->
|
||||||
Key = {Vcs, Dir},
|
Key = {Vcs, Dir},
|
||||||
case ets:lookup(rebar_vsn_cache, Key) of
|
try ets:lookup_element(rebar_vsn_cache, Key, 2) of
|
||||||
[{Key, VsnString}] ->
|
VsnString ->
|
||||||
VsnString;
|
VsnString
|
||||||
[] ->
|
catch
|
||||||
|
error:badarg ->
|
||||||
VsnString = vcs_vsn_1(Vcs, Dir),
|
VsnString = vcs_vsn_1(Vcs, Dir),
|
||||||
ets:insert(rebar_vsn_cache, {Key, VsnString}),
|
ets:insert(rebar_vsn_cache, {Key, VsnString}),
|
||||||
VsnString
|
VsnString
|
||||||
|
|
Loading…
Reference in a new issue