Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix owncloudsql upload without mtime #2831

Merged
merged 2 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 3 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 @@ -107,6 +108,8 @@ func (fs *owncloudsqlfs) InitiateUpload(ctx context.Context, ref *provider.Refer
if metadata != nil {
if metadata["mtime"] != "" {
info.MetaData["mtime"] = metadata["mtime"]
} else {
info.MetaData["mtime"] = strconv.FormatInt(time.Now().Unix(), 10)
wkloucek marked this conversation as resolved.
Show resolved Hide resolved
}
if _, ok := metadata["sizedeferred"]; ok {
info.SizeIsDeferred = true
Expand Down