From 038d2c440b24b7c0f1ea72e0bfeda369f766c691 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 23 May 2023 20:15:49 -0400 Subject: [PATCH] fix: save upload info after every chunk --- tusstore/store.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tusstore/store.go b/tusstore/store.go index 6744d57..d01a0b6 100644 --- a/tusstore/store.go +++ b/tusstore/store.go @@ -156,6 +156,12 @@ func (upload *fileUpload) WriteChunk(ctx context.Context, offset int64, src io.R n, err := io.Copy(file, src) upload.info.Offset += n + + err = upload.writeInfo() + if err != nil { + return 0, err + } + return n, err }