MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / refreshPubCache

Method refreshPubCache

internal/job/refresh_cache.go:69–82  ·  view source on GitHub ↗

刷新发布的帖子缓存

(ctx context.Context, key, postId string, logger *zap.Logger)

Source from the content-addressed store, hash-verified

67
68// 刷新发布的帖子缓存
69func (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// 刷新普通帖子缓存
85func (r *RefreshCacheTask) refreshNormalCache(ctx context.Context, key, postId string, logger *zap.Logger) error {

Callers 1

ProcessTaskMethod · 0.95

Calls 2

DelPubListMethod · 0.65
DelPubMethod · 0.65

Tested by

no test coverage detected