refactor: pass id to FileInfo and use info in fileUpload

This commit is contained in:
Derrick Hammer 2023-05-23 20:15:08 -04:00
parent 89ef950432
commit 56d61895f5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 4 deletions

View File

@ -77,12 +77,12 @@ func (store DbFileStore) NewUpload(ctx context.Context, info handler.FileInfo) (
}
func (store DbFileStore) GetUpload(ctx context.Context, id string) (handler.Upload, error) {
info := handler.FileInfo{}
fUpload := &fileUpload{
info: info,
info := handler.FileInfo{
ID: id,
}
fUpload := &fileUpload{info: info}
record, is404, err := fUpload.getInfo()
if err != nil {
if is404 {
@ -96,6 +96,8 @@ func (store DbFileStore) GetUpload(ctx context.Context, id string) (handler.Uplo
return nil, err
}
fUpload.info = info
fUpload.hash = record.Hash
binPath := store.binPath(id)
stat, err := os.Stat(binPath)