mirror of
https://github.com/ZoneTree/ZoneTree.git
synced 2026-10-27 03:59:47 +08:00
Improve cache index collision handler.
This commit is contained in:
@@ -30,7 +30,10 @@ public class CircularBlockCache
|
||||
block,
|
||||
(key, existingBlock) =>
|
||||
{
|
||||
if (existingBlock.LastAccessTicks +
|
||||
// todo: add secondary table to optimize
|
||||
// cache index collision.
|
||||
if (MaxCachedBlockCount > 32 &&
|
||||
existingBlock.LastAccessTicks +
|
||||
MinimumBlockLifeSpanInMilliseconds >
|
||||
DateTime.UtcNow.Ticks)
|
||||
return existingBlock;
|
||||
|
||||
Reference in New Issue
Block a user