added notion of expiration to snapshot. Full scan to trim the snapshot is no longer needed

This commit is contained in:
Manuel Simon Hirsig
2016-01-17 06:19:30 +01:00
parent a1cfce2300
commit 9c520df47c
6 changed files with 79 additions and 41 deletions
-11
View File
@@ -31,13 +31,11 @@ function public.start_scan()
private.process_auction(auction_info)
end,
on_complete = function()
private.update_snapshot()
Aux.log('Scan complete: Old auctions were removed from the snapshot.')
-- AuxHistoryStopButton:Hide()
-- AuxHistoryScanButton:Show()
end,
on_abort = function()
Aux.log('Scanning aborted.')
-- AuxHistoryStopButton:Hide()
-- AuxHistoryScanButton:Show()
@@ -55,15 +53,6 @@ function public.stop_scan()
Aux.scan.abort()
end
function private.update_snapshot()
local snapshot = Aux.persistence.load_snapshot()
for _, sig in ipairs(snapshot.values()) do
if not private.scanned_signatures.contains(sig) then
snapshot.remove(sig)
end
end
end
function private.process_auction(auction_info)
private.scanned_signatures.add(auction_info.signature)
end