feat: pin file after tus upload
This commit is contained in:
parent
8692a0225e
commit
5579ab85a3
|
@ -166,7 +166,7 @@ func tusWorker(upload *tusd.Upload) error {
|
|||
return err
|
||||
}
|
||||
|
||||
_, err = files.Upload(file.(io.ReadSeeker), info.Size, hashBytes)
|
||||
newUpload, err := files.Upload(file.(io.ReadSeeker), info.Size, hashBytes)
|
||||
tErr := terminateUpload(*upload)
|
||||
|
||||
if tErr != nil {
|
||||
|
@ -177,6 +177,11 @@ func tusWorker(upload *tusd.Upload) error {
|
|||
return err
|
||||
}
|
||||
|
||||
err = files.Pin(newUpload.Hash, newUpload.AccountID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue