feat: use real image path to calculate cache key

This commit is contained in:
Oleg Lobanov
2022-02-21 19:59:22 +01:00
parent cf85404dd2
commit c1987237d0
3 changed files with 18 additions and 5 deletions

View File

@@ -283,7 +283,7 @@ func writeFile(fs afero.Fs, dst string, in io.Reader) (os.FileInfo, error) {
func delThumbs(ctx context.Context, fileCache FileCache, file *files.FileInfo) error {
for _, previewSizeName := range PreviewSizeNames() {
size, _ := ParsePreviewSize(previewSizeName)
if err := fileCache.Delete(ctx, previewCacheKey(file.Path, file.ModTime.Unix(), size)); err != nil {
if err := fileCache.Delete(ctx, previewCacheKey(file, size)); err != nil {
return err
}
}