刷新发布的帖子缓存
(ctx context.Context, key, postId string, logger *zap.Logger)
| 67 | |
| 68 | // 刷新发布的帖子缓存 |
| 69 | func (r *RefreshCacheTask) refreshPubCache(ctx context.Context, key, postId string, logger *zap.Logger) error { |
| 70 | if err := r.cache.DelPubList(ctx, key); err != nil { |
| 71 | logger.Error("删除发布帖子列表缓存失败", zap.Error(err)) |
| 72 | return fmt.Errorf("删除发布帖子列表缓存失败: %w", err) |
| 73 | } |
| 74 | |
| 75 | if err := r.cache.DelPub(ctx, postId); err != nil { |
| 76 | logger.Error("删除发布帖子缓存失败", zap.Error(err)) |
| 77 | return fmt.Errorf("删除发布帖子缓存失败: %w", err) |
| 78 | } |
| 79 | |
| 80 | logger.Info("删除发布帖子缓存成功") |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | // 刷新普通帖子缓存 |
| 85 | func (r *RefreshCacheTask) refreshNormalCache(ctx context.Context, key, postId string, logger *zap.Logger) error { |
no test coverage detected