get the proper path for blobs to delete (#168)

This commit is contained in:
Patrick Devine 2023-07-21 17:30:40 -07:00 committed by GitHub
parent 9f6e97865c
commit b8421dce3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -548,9 +548,13 @@ func DeleteModel(name string, fn func(api.ProgressResponse)) error {
// only delete the files which are still in the deleteMap
for k, v := range deleteMap {
if v {
err := os.Remove(k)
fp, err := GetBlobsPath(k)
if err != nil {
log.Printf("couldn't remove file '%s': %v", k, err)
log.Printf("couldn't get file path for '%s': %v", k, err)
continue
}
if err := os.Remove(fp); err != nil {
log.Printf("couldn't remove file '%s': %v", fp, err)
continue
}
}