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:
parent
1e88c05dbe
commit
dce62a88a9
1 changed files with 3 additions and 2 deletions
|
@ -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 ->
|
||||||
|
|
Loading…
Reference in a new issue