refactor: pass id to FileInfo and use info in fileUpload
This commit is contained in:
parent
89ef950432
commit
56d61895f5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue