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

Time duration can identify the number of days #4002

Closed
wants to merge 1 commit into from

Conversation

feeyman
Copy link
Contributor

@feeyman feeyman commented Aug 16, 2023

In some scenarios, the time parameter supports days, which is better. For example, data is rarely modified and the backup interval is expected to be one week. Although 168h can also be used, 7d is more intuitive, such as --backup-meta 7d.

@davies davies added this to the Release 1.2 milestone Aug 16, 2023
@@ -323,7 +325,51 @@ func expandFlags(compoundFlags ...[]cli.Flag) []cli.Flag {
return flags
}

func parseDuration(input string) (time.Duration, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use time.ParseDuration to cover most of the cases, and handle 7d here.

@davies
Copy link
Contributor

davies commented Dec 12, 2023

took over by #4246

@davies davies closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants