Fix snapshot issue
This commit is contained in:
parent
e6270d288f
commit
2c828b8eca
1 changed files with 9 additions and 2 deletions
|
@ -255,7 +255,7 @@ init([Opts]) ->
|
||||||
{ok,
|
{ok,
|
||||||
{Penciller, LedgerCache},
|
{Penciller, LedgerCache},
|
||||||
Inker} = book_snapshotstore(Bookie, self(), ?SNAPSHOT_TIMEOUT),
|
Inker} = book_snapshotstore(Bookie, self(), ?SNAPSHOT_TIMEOUT),
|
||||||
ok = leveled_penciller:pcl_loadsnapshot(Penciller, LedgerCache),
|
ok = load_snapshot(Penciller, LedgerCache),
|
||||||
leveled_log:log("B0002", [Inker, Penciller]),
|
leveled_log:log("B0002", [Inker, Penciller]),
|
||||||
{ok, #state{penciller=Penciller,
|
{ok, #state{penciller=Penciller,
|
||||||
inker=Inker,
|
inker=Inker,
|
||||||
|
@ -761,7 +761,14 @@ startup(InkerOpts, PencillerOpts) ->
|
||||||
|
|
||||||
fetch_head(Key, Penciller, LedgerCache) ->
|
fetch_head(Key, Penciller, LedgerCache) ->
|
||||||
SW = os:timestamp(),
|
SW = os:timestamp(),
|
||||||
case ets:lookup(LedgerCache#ledger_cache.mem, Key) of
|
CacheResult =
|
||||||
|
case LedgerCache#ledger_cache.mem of
|
||||||
|
undefined ->
|
||||||
|
[];
|
||||||
|
Tab ->
|
||||||
|
ets:lookup(Tab, Key)
|
||||||
|
end,
|
||||||
|
case CacheResult of
|
||||||
[{Key, Head}] ->
|
[{Key, Head}] ->
|
||||||
Head;
|
Head;
|
||||||
[] ->
|
[] ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue