adding modified time to file chunk

This commit is contained in:
Chris Lu
2018-05-16 00:54:44 -07:00
parent 6bf31467c7
commit e31c514b00
5 changed files with 64 additions and 49 deletions

View File

@@ -24,6 +24,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"time"
)
type FilerPostResult struct {
@@ -335,6 +336,7 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) {
Chunks: []*filer_pb.FileChunk{{
FileId: fileId,
Size: uint64(r.ContentLength),
Mtime: time.Now().UnixNano(),
}},
}
if db_err := fs.filer.CreateEntry(entry); db_err != nil {
@@ -460,6 +462,7 @@ func (fs *FilerServer) doAutoChunk(w http.ResponseWriter, r *http.Request, conte
FileId: fileId,
Offset: chunkOffset,
Size: uint64(chunkBufOffset),
Mtime: time.Now().UnixNano(),
},
)