1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-26 16:12:13 +02:00

[#1187] move file upload and delete out of the record save transaction

This commit is contained in:
Gani Georgiev
2022-12-06 12:26:29 +02:00
parent 808f5054d0
commit 355f7053fd
3 changed files with 77 additions and 47 deletions

View File

@@ -176,13 +176,11 @@ func (s *System) DeletePrefix(prefix string) []error {
dirsMap := map[string]struct{}{}
dirsMap[prefix] = struct{}{}
opts := blob.ListOptions{
Prefix: prefix,
}
// delete all files with the prefix
// ---
iter := s.bucket.List(&opts)
iter := s.bucket.List(&blob.ListOptions{
Prefix: prefix,
})
for {
obj, err := iter.Next(s.ctx)
if err == io.EOF {