fix:处理了边界情况

This commit is contained in:
Amnesia
2026-03-14 18:57:02 +08:00
parent 39243c14d7
commit 9eed15efd5
5 changed files with 23 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ func NewTimelineMQ(base *RabbitMQ) (*TimelineMQ, error) {
func (t *TimelineMQ) PublishVideo(ctx context.Context, videoID uint, createTime time.Time) error {
if t == nil || t.RabbitMQ == nil {
return errors.New("like mq is not initialized")
return errors.New("timelike mq is not initialized")
}
if videoID == 0 {
return errors.New("videoID are required")

View File

@@ -3,8 +3,6 @@ package redis
import (
"context"
"time"
"github.com/redis/go-redis/v9"
)
func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error) {
@@ -19,6 +17,6 @@ func (c *Client) Del(ctx context.Context, key string) error {
return c.rdb.Del(ctx, key).Err()
}
func (c *Client) MGet(cacheCtx context.Context, cacheKeys ...string) *redis.SliceCmd {
return c.rdb.MGet(cacheCtx, cacheKeys...)
func (c *Client) MGet(cacheCtx context.Context, cacheKeys ...string) ([]interface{}, error) {
return c.rdb.MGet(cacheCtx, cacheKeys...).Result()
}