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

cmd: add unit for all time options #4671

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
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
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
Loading