mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer update existing entry
This commit is contained in:
parent
6071be104b
commit
7b7f4215aa
|
@ -187,11 +187,20 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// update metadata in filer store
|
// update metadata in filer store
|
||||||
glog.V(4).Infoln("saving", path, "=>", fileId)
|
glog.V(4).Infoln("saving", path, "=>", fileId)
|
||||||
|
existingEntry, err := fs.filer.FindEntry(filer2.FullPath(path))
|
||||||
|
crTime := time.Now()
|
||||||
|
if err == nil && existingEntry != nil {
|
||||||
|
if existingEntry.IsDirectory() {
|
||||||
|
path += ret.Name
|
||||||
|
} else {
|
||||||
|
crTime = existingEntry.Crtime
|
||||||
|
}
|
||||||
|
}
|
||||||
entry := &filer2.Entry{
|
entry := &filer2.Entry{
|
||||||
FullPath: filer2.FullPath(path),
|
FullPath: filer2.FullPath(path),
|
||||||
Attr: filer2.Attr{
|
Attr: filer2.Attr{
|
||||||
Mtime: time.Now(),
|
Mtime: time.Now(),
|
||||||
Crtime: time.Now(),
|
Crtime: crTime,
|
||||||
Mode: 0660,
|
Mode: 0660,
|
||||||
Uid: OS_UID,
|
Uid: OS_UID,
|
||||||
Gid: OS_GID,
|
Gid: OS_GID,
|
||||||
|
|
Loading…
Reference in a new issue