mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 05:51:39 +00:00
fix: upload url generation
This commit is contained in:
@@ -58,12 +58,17 @@ func (s *Service) CreateUpload(ctx context.Context, db bun.IDB, accountID uuid.U
|
||||
return nil, err
|
||||
}
|
||||
|
||||
uploadURL, err := s.blobStore.GenerateUploadURL(ctx, node.BlobKey, blob.UploadURLOptions{
|
||||
Duration: 1 * time.Hour,
|
||||
})
|
||||
if err != nil {
|
||||
_ = s.vfs.PermanentlyDeleteNode(ctx, db, node)
|
||||
return nil, err
|
||||
var uploadURL string
|
||||
if s.blobStore.SupportsDirectUpload() {
|
||||
uploadURL, err = s.blobStore.GenerateUploadURL(ctx, node.BlobKey, blob.UploadURLOptions{
|
||||
Duration: 1 * time.Hour,
|
||||
})
|
||||
if err != nil {
|
||||
_ = s.vfs.PermanentlyDeleteNode(ctx, db, node)
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
uploadURL = ""
|
||||
}
|
||||
|
||||
upload := &Upload{
|
||||
|
||||
Reference in New Issue
Block a user