Fix invalid error

This fixes https://github.com/krestenkrab/hanoidb/issues/12
where an old file descriptor is used when storing
2i (transact data) causes the tx log to roll.
This commit is contained in:
Kresten Krab Thorup 2012-09-24 17:31:32 +02:00
parent 1e88c05dbe
commit dce62a88a9

View file

@ -264,9 +264,10 @@ ensure_space(Nursery, NeededRoom, Top) ->
flush(Nursery, Top) flush(Nursery, Top)
end. end.
transact(Spec, Nursery=#nursery{ log_file=File, cache=Cache0, total_size=TotalSize, config=Config }, Top) -> transact(Spec, Nursery, Top) ->
Nursery1 = ensure_space(Nursery, length(Spec), 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 = Expiry =
case hanoidb:get_opt(expiry_secs, Config) of case hanoidb:get_opt(expiry_secs, Config) of
0 -> 0 ->