Skip to content

Commit

Permalink
fix owncloudsql upload without mtime (#2831)
Browse files Browse the repository at this point in the history
* fix owncloudsql upload without mtime

* set default mtime
  • Loading branch information
wkloucek authored May 6, 2022
1 parent 7ff3d93 commit 264eb90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-owncloudsql-storage-no-mtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix uploads to owncloudsql storage when no mtime is provided

We've fixed uploads to owncloudsql storage when no mtime is provided.
We now just use the current timestamp. Previously the upload did fail.

https://github.com/cs3org/reva/pull/2831
2 changes: 2 additions & 0 deletions pkg/storage/fs/owncloudsql/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"os"
"path/filepath"
"strconv"
"time"

userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
Expand Down Expand Up @@ -100,6 +101,7 @@ func (fs *owncloudsqlfs) InitiateUpload(ctx context.Context, ref *provider.Refer
MetaData: tusd.MetaData{
"filename": filepath.Base(p),
"dir": filepath.Dir(p),
"mtime": strconv.FormatInt(time.Now().Unix(), 10),
},
Size: uploadLength,
}
Expand Down

0 comments on commit 264eb90

Please sign in to comment.