diff --git a/pkg/structure/interface.gen.go b/pkg/structure/interface.gen.go index 6ed2c1e..b9b806a 100644 --- a/pkg/structure/interface.gen.go +++ b/pkg/structure/interface.gen.go @@ -15,10 +15,10 @@ type KeyBaseInterface interface { type StringXInterface interface { KeyBaseInterface - Set(val string) (string, UpdateLength) + Set(string) (string, UpdateLength) Get() string - Add(renewal int32) (string, error) - Reduce(renewal int32) (string, error) - Setbit(offer int32, val bool) UpdateLength - Getbit(offer int32) (bool, error) + Add(int32) (string, error) + Reduce(int32) (string, error) + Setbit(int32, bool) UpdateLength + Getbit(int32) (bool, error) } diff --git a/storage/dao/dao.go b/storage/dao/dao.go index 8cd9b04..d061e5e 100644 --- a/storage/dao/dao.go +++ b/storage/dao/dao.go @@ -32,9 +32,11 @@ func (d *Dao) Set(key *proto.BaseKey, strVal string) (string, error) { // 不存在新建 strValue := stringx.NewStringSingle() - result, length := strValue.Set(strVal) - d.lru.Add(key, strValue) - d.lru.UpdateLruSize(length) + result, _ := strValue.Set(strVal) + err := d.lru.Add(key, strValue) + if err != nil { + return "", err + } return result, nil }