Empty non-persisted parts of record on save
Some of the manifest should not be preserved between restarts - so empty these parts on save
This commit is contained in:
parent
c098eca06e
commit
6298886592
1 changed files with 3 additions and 1 deletions
|
@ -123,7 +123,9 @@ close_manifest(Manifest, CloseEntryFun) ->
|
||||||
|
|
||||||
save_manifest(Manifest, RootPath) ->
|
save_manifest(Manifest, RootPath) ->
|
||||||
FP = filepath(RootPath, Manifest#manifest.manifest_sqn, current_manifest),
|
FP = filepath(RootPath, Manifest#manifest.manifest_sqn, current_manifest),
|
||||||
ManBin = term_to_binary(Manifest),
|
ManBin = term_to_binary(Manifest#manifest{snapshots = [],
|
||||||
|
pending_deletes = dict:new(),
|
||||||
|
min_snapshot_sqn = 0}),
|
||||||
CRC = erlang:crc32(ManBin),
|
CRC = erlang:crc32(ManBin),
|
||||||
ok = file:write_file(FP, <<CRC:32/integer, ManBin/binary>>).
|
ok = file:write_file(FP, <<CRC:32/integer, ManBin/binary>>).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue