fix:处理了边界情况
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user