feat: improve defaultAdapter to add clean timer

This commit is contained in:
weloe
2023-05-09 15:28:27 +08:00
parent 4a14a250dc
commit f45277b4d5
6 changed files with 62 additions and 10 deletions

View File

@@ -181,6 +181,7 @@ func TestDefaultAdapter_InterfaceOperation(t *testing.T) {
func TestDefaultAdapter_DeleteBatchFilteredValue(t *testing.T) {
adapter := NewTestDefaultAdapter()
adapter.(*DefaultAdapter).StartCleanTimer(2)
if err := adapter.SetStr("k_1", "v", -1); err != nil {
t.Errorf("SetStr() failed: %v", err)
}
@@ -198,4 +199,5 @@ func TestDefaultAdapter_DeleteBatchFilteredValue(t *testing.T) {
if str != "" {
t.Errorf("DeleteBatchFilteredKey() failed")
}
time.Sleep(5 * time.Second)
}