s3 避免缓存击穿

This commit is contained in:
2025-04-21 14:37:51 +08:00
parent 2971c5f52d
commit e6f93a4d37
2 changed files with 23 additions and 0 deletions

View File

@ -26,6 +26,9 @@ func (l *LocalAdapter) GetFileList(ctx context.Context, dirPath string, relDt ti
span.SetStatus(codes.Error, "未配置存储路径")
return nil, fmt.Errorf("未配置存储路径")
}
span.SetAttributes(attribute.String("path", dirPath))
span.SetAttributes(attribute.String("relativeDate", relDt.Format("2006-01-02")))
// 读取文件夹下目录
files, err := os.ReadDir(path.Join(l.StorageConfig.Path, dirPath))
if err != nil {