diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-08-31 18:02:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 18:02:11 +0800 |
| commit | 44a56b158e4637bd70d3fcf8ddc9107973b60558 (patch) | |
| tree | 4cf59d290d346c6ea06d617531c90d2653f3bc03 /weed/shell/command_fs_meta_cat.go | |
| parent | b0d6330cf44dbb0664f6ede0dbc82865879dcfe0 (diff) | |
| parent | 408e339c53b9b6626e81f1c3f0f2399494bf4ce6 (diff) | |
| download | seaweedfs-44a56b158e4637bd70d3fcf8ddc9107973b60558.tar.xz seaweedfs-44a56b158e4637bd70d3fcf8ddc9107973b60558.zip | |
Merge pull request #13 from chrislusf/master
sync
Diffstat (limited to 'weed/shell/command_fs_meta_cat.go')
| -rw-r--r-- | weed/shell/command_fs_meta_cat.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/shell/command_fs_meta_cat.go b/weed/shell/command_fs_meta_cat.go index 0679ec075..8cba2d520 100644 --- a/weed/shell/command_fs_meta_cat.go +++ b/weed/shell/command_fs_meta_cat.go @@ -3,6 +3,7 @@ package shell import ( "fmt" "io" + "sort" "github.com/golang/protobuf/jsonpb" @@ -54,6 +55,13 @@ func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.W Indent: " ", } + sort.Slice(respLookupEntry.Entry.Chunks, func(i, j int) bool { + if respLookupEntry.Entry.Chunks[i].Offset == respLookupEntry.Entry.Chunks[j].Offset { + return respLookupEntry.Entry.Chunks[i].Mtime < respLookupEntry.Entry.Chunks[j].Mtime + } + return respLookupEntry.Entry.Chunks[i].Offset < respLookupEntry.Entry.Chunks[j].Offset + }) + text, marshalErr := m.MarshalToString(respLookupEntry.Entry) if marshalErr != nil { return fmt.Errorf("marshal meta: %v", marshalErr) |
