Skip to content

Commit

Permalink
cmd: add unit for all time options (#4671)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyXSD authored Apr 9, 2024
1 parent 686b872 commit cfe0ce6
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package cmd

import (
"fmt"
"github.com/urfave/cli/v2"
"os"
"path"
"runtime"

"github.com/urfave/cli/v2"
)

func globalFlags() []cli.Flag {
Expand Down Expand Up @@ -109,12 +110,12 @@ func storageFlags() []cli.Flag {
&cli.StringFlag{
Name: "get-timeout",
Value: "60s",
Usage: "the max number of seconds to download an object",
Usage: "the timeout to download an object",
},
&cli.StringFlag{
Name: "put-timeout",
Value: "60s",
Usage: "the max number of seconds to upload an object",
Usage: "the timeout to upload an object",
},
&cli.IntFlag{
Name: "io-retries",
Expand Down Expand Up @@ -177,8 +178,8 @@ func dataCacheFlags() []cli.Flag {
},
&cli.StringFlag{
Name: "upload-delay",
Value: "0",
Usage: "delayed duration (in seconds) for uploading blocks",
Value: "0s",
Usage: "delayed duration for uploading blocks",
},
&cli.StringFlag{
Name: "upload-hours",
Expand Down Expand Up @@ -220,12 +221,12 @@ func dataCacheFlags() []cli.Flag {
},
&cli.StringFlag{
Name: "cache-scan-interval",
Value: "3600",
Usage: "interval (in seconds) to scan cache-dir to rebuild in-memory index",
Value: "1h",
Usage: "interval to scan cache-dir to rebuild in-memory index",
},
&cli.StringFlag{
Name: "cache-expire",
Value: "0",
Value: "0s",
Usage: "cached blocks not accessed for longer than this option will be automatically evicted (0 means never)",
},
})
Expand All @@ -239,17 +240,17 @@ func metaFlags() []cli.Flag {
},
&cli.StringFlag{
Name: "backup-meta",
Value: "3600",
Usage: "interval (in seconds) to automatically backup metadata in the object storage (0 means disable backup)",
Value: "1h",
Usage: "interval to automatically backup metadata in the object storage (0 means disable backup)",
},
&cli.BoolFlag{
Name: "backup-skip-trash",
Usage: "skip files in trash when backup metadata",
},
&cli.StringFlag{
Name: "heartbeat",
Value: "12",
Usage: "interval (in seconds) to send heartbeat; it's recommended that all clients use the same heartbeat value",
Value: "12s",
Usage: "interval to send heartbeat; it's recommended that all clients use the same heartbeat value",
},
&cli.BoolFlag{
Name: "read-only",
Expand Down Expand Up @@ -313,23 +314,23 @@ func metaCacheFlags(defaultEntryCache float64) []cli.Flag {
return addCategories("META CACHE", []cli.Flag{
&cli.StringFlag{
Name: "attr-cache",
Value: "1s",
Value: "1.0s",
Usage: "attributes cache timeout",
},
&cli.StringFlag{
Name: "entry-cache",
Value: fmt.Sprintf("%.1f", defaultEntryCache),
Value: fmt.Sprintf("%.1fs", defaultEntryCache),
Usage: "file entry cache timeout",
},
&cli.StringFlag{
Name: "dir-entry-cache",
Value: "1s",
Value: "1.0s",
Usage: "dir entry cache timeout",
},
&cli.StringFlag{
Name: "open-cache",
Value: "0",
Usage: "The seconds to reuse open file without checking update (0 means disable this feature)",
Value: "0s",
Usage: "The cache time to reuse open file without checking update (0 means disable this feature)",
},
&cli.Uint64Flag{
Name: "open-cache-limit",
Expand Down

0 comments on commit cfe0ce6

Please sign in to comment.