Skip to content

Commit

Permalink
fix: should use storage key for delete on error
Browse files Browse the repository at this point in the history
  • Loading branch information
cshum committed Aug 24, 2024
1 parent a510db8 commit b5d4c77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imagor.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ func (app *Imagor) Do(r *http.Request, p imagorpath.Params) (blob *Blob, err err
app.save(ctx, app.ResultStorages, resultKey, blob)
}
if err != nil && shouldSave {
app.del(ctx, app.Storages, p.Image)
var storageKey = p.Image
if app.StoragePathStyle != nil {
storageKey = app.StoragePathStyle.Hash(p.Image)
}
app.del(ctx, app.Storages, storageKey)
}
return blob, err
})
Expand Down

0 comments on commit b5d4c77

Please sign in to comment.