Skip to content

Commit

Permalink
Fix invalid error
Browse files Browse the repository at this point in the history
This fixes krestenkrab#12
where an old file descriptor is used when storing
2i (transact data) causes the tx log to roll.
  • Loading branch information
krestenkrab committed Sep 24, 2012
1 parent 1e88c05 commit dce62a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hanoidb_nursery.erl
Expand Up @@ -264,9 +264,10 @@ ensure_space(Nursery, NeededRoom, Top) ->
flush(Nursery, Top)
end.

transact(Spec, Nursery=#nursery{ log_file=File, cache=Cache0, total_size=TotalSize, config=Config }, Top) ->
Nursery1 = ensure_space(Nursery, length(Spec), Top),
transact(Spec, Nursery, Top) ->
transact1(Spec, ensure_space(Nursery, length(Spec), Top), Top).

transact1(Spec, Nursery1=#nursery{ log_file=File, cache=Cache0, total_size=TotalSize, config=Config }, Top) ->
Expiry =
case hanoidb:get_opt(expiry_secs, Config) of
0 ->
Expand Down

0 comments on commit dce62a8

Please sign in to comment.