🐛 Trying fix deleting attachment issue

This commit is contained in:
2024-12-25 23:52:00 +08:00
parent 411b2f3313
commit ae6815b2a4
4 changed files with 14 additions and 28 deletions

View File

@@ -3,7 +3,6 @@ package services
import (
"context"
"fmt"
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"math"
"mime"
"mime/multipart"
@@ -11,6 +10,8 @@ import (
"path/filepath"
"time"
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"github.com/eko/gocache/lib/v4/cache"
"github.com/eko/gocache/lib/v4/marshaler"
"github.com/eko/gocache/lib/v4/store"
@@ -251,7 +252,7 @@ func DeleteAttachment(item models.Attachment) error {
tx.Commit()
if dat.RefCount == 0 {
PublishDeleteFileTask(dat)
go DeleteFile(dat)
}
return nil