Delete Public files (#370)

* enable storing public files

* add delete for files
This commit is contained in:
Asim Aslam
2022-02-11 14:36:10 +00:00
committed by GitHub
parent 7e05a193ac
commit b0e7cf11e3

View File

@@ -66,6 +66,20 @@ func (e *File) Delete(ctx context.Context, req *file.DeleteRequest, rsp *file.De
store.Delete(file)
}
path = filepath.Join(pathPrefix, tenantId, req.Project, req.Path)
// check if the files are in the blob store and delete if they exist
keys, err := store.DefaultBlobStore.List(store.BlobListPrefix(path))
if err != nil {
log.Error("Failed to list blob store keys %s: %v", path, err)
return nil
}
// delete the files from the blob store
for _, file := range keys {
store.DefaultBlobStore.Delete(file)
}
return nil
}