fix: we need to pin the file after creating the upload
This commit is contained in:
parent
8df2ee9ee8
commit
fb1112f3a2
|
@ -564,12 +564,18 @@ func (s *StorageServiceImpl) buildNewTusUploadTask(upload *models.TusUpload) (jo
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.CreateUpload(dbHash, upload.UploaderID, upload.UploaderIP, uint64(byteCount), upload.Protocol)
|
newUpload, err := s.CreateUpload(dbHash, upload.UploaderID, upload.UploaderIP, uint64(byteCount), upload.Protocol)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.portal.Logger().Error("Could not create upload", zap.Error(err))
|
s.portal.Logger().Error("Could not create upload", zap.Error(err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.portal.Accounts().PinByID(newUpload.ID, upload.UploaderID)
|
||||||
|
if err != nil {
|
||||||
|
s.portal.Logger().Error("Could not pin upload", zap.Error(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}, upload)
|
}, upload)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue