feat: create upload record after sending to renterd

This commit is contained in:
Derrick Hammer 2024-01-22 18:25:11 -05:00
parent 3fcb897e7a
commit bf36562fca
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 12 additions and 0 deletions

View File

@ -538,6 +538,18 @@ func (s *StorageServiceImpl) buildNewTusUploadTask(upload *models.TusUpload) (jo
return err return err
} }
info, err := tusUpload.GetInfo(ctx)
if err != nil {
s.portal.Logger().Error("Could not get upload info", zap.Error(err))
return err
}
_, err = s.CreateUpload(dbHash, upload.UploaderID, upload.UploaderIP, uint64(info.Size), upload.Protocol)
if err != nil {
s.portal.Logger().Error("Could not create upload", zap.Error(err))
return err
}
return nil return nil
}, upload) }, upload)