|
|
@ -7,6 +7,7 @@ import (
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"github.com/dtm-labs/rockscache"
|
|
|
|
"github.com/dtm-labs/rockscache"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -85,6 +86,9 @@ func getCache[T any](ctx context.Context, rcClient *rockscache.Client, key strin
|
|
|
|
if write {
|
|
|
|
if write {
|
|
|
|
return t, nil
|
|
|
|
return t, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if v == "" {
|
|
|
|
|
|
|
|
return t, errs.ErrRecordNotFound
|
|
|
|
|
|
|
|
}
|
|
|
|
err = json.Unmarshal([]byte(v), &t)
|
|
|
|
err = json.Unmarshal([]byte(v), &t)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.ZError(ctx, "cache json.Unmarshal failed", err, "key", key, "value", v, "expire", expire)
|
|
|
|
log.ZError(ctx, "cache json.Unmarshal failed", err, "key", key, "value", v, "expire", expire)
|
|
|
|