diff --git a/tusstore/store.go b/tusstore/store.go index 6a8abf3..8455831 100644 --- a/tusstore/store.go +++ b/tusstore/store.go @@ -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)