mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-06 00:16:53 +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:
@@ -138,7 +138,7 @@ func Test_HandleSetRange(t *testing.T) {
|
||||
if _, err = mockServer.KeyRLock(context.Background(), test.key); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
value, ok := mockServer.GetValue(test.key).(string)
|
||||
value, ok := mockServer.GetValue(context.Background(), test.key).(string)
|
||||
if !ok {
|
||||
t.Error("expected string data type, got another type")
|
||||
}
|
||||
|
Reference in New Issue
Block a user