mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-16 13:00:40 +08:00
Added addedTime to EntryLFU object to control which entry will be removed if access count is the same. If two entries have the same access count, the older entry should be removed first.
SetKeyExpiry and GetValue keyspace receiver functions now require context object to be passed. Created adjustMemoryUsage function for key eviction for LFU, LRU, and Random eviction policies. Updated all modules to pass context to SetKeyExpirty and GetValue functions.
This commit is contained in:
@@ -80,7 +80,8 @@ The options are 'always' for syncing on each command, 'everysec' to sync every s
|
||||
|
||||
var maxMemory uint64 = 0
|
||||
flag.Func("max-memory", `Upper memory limit before triggering eviction.
|
||||
Supported units (kb, mb, gb, tb, pb). There is no limit by default.`, func(memory string) error {
|
||||
Supported units (kb, mb, gb, tb, pb). When 0 is passed, there will be no memory limit.
|
||||
There is no limit by default.`, func(memory string) error {
|
||||
b, err := ParseMemory(memory)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user