Merge pull request #10 from yamt/fixes
Fixes issue with long running range fold
introduced in f324972cdd
This commit is contained in:
commit
f34f2c5ec2
1 changed files with 3 additions and 3 deletions
|
@ -439,10 +439,10 @@ main_loop(State = #state{ next=Next }) ->
|
||||||
|
|
||||||
?log("init_range_fold ~p -> ~p", [Range, WorkerPID]),
|
?log("init_range_fold ~p -> ~p", [Range, WorkerPID]),
|
||||||
|
|
||||||
{FoldingPIDs, NextList} =
|
{NextList, FoldingPIDs} =
|
||||||
case {State#state.a, State#state.b, State#state.c} of
|
case {State#state.a, State#state.b, State#state.c} of
|
||||||
{undefined, undefined, undefined} ->
|
{undefined, undefined, undefined} ->
|
||||||
{[], List};
|
{List, []};
|
||||||
|
|
||||||
{_, undefined, undefined} ->
|
{_, undefined, undefined} ->
|
||||||
ok = file:make_link(filename("A", State), filename("AF", State)),
|
ok = file:make_link(filename("A", State), filename("AF", State)),
|
||||||
|
@ -821,7 +821,7 @@ start_range_fold(FileName, WorkerPID, Range, State) ->
|
||||||
Owner = self(),
|
Owner = self(),
|
||||||
PID = proc_lib:spawn( fun() ->
|
PID = proc_lib:spawn( fun() ->
|
||||||
try
|
try
|
||||||
?log("start_range_fold ~p on ~p -> ~p", [self, FileName, WorkerPID]),
|
?log("start_range_fold ~p on ~p -> ~p", [self(), FileName, WorkerPID]),
|
||||||
erlang:link(WorkerPID),
|
erlang:link(WorkerPID),
|
||||||
{ok, File} = hanoidb_reader:open(FileName, [folding|State#state.opts]),
|
{ok, File} = hanoidb_reader:open(FileName, [folding|State#state.opts]),
|
||||||
do_range_fold2(File, WorkerPID, self(), Range),
|
do_range_fold2(File, WorkerPID, self(), Range),
|
||||||
|
|
Loading…
Reference in a new issue