Skip to content

Commit

Permalink
The upload-hours parameter supports - as a separator (#5494)
Browse files Browse the repository at this point in the history
Signed-off-by: zhijian <[email protected]>
  • Loading branch information
zhijian-pro authored Jan 3, 2025
1 parent d6fcdf1 commit 74a0890
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func dataCacheFlags() []cli.Flag {
},
&cli.StringFlag{
Name: "upload-hours",
Usage: "(start,end) hour of a day between which the delayed blocks can be uploaded",
Usage: "(start-end) hour of a day between which the delayed blocks can be uploaded",
},
&cli.StringFlag{
Name: "cache-dir",
Expand Down
6 changes: 5 additions & 1 deletion pkg/chunk/cached_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,11 @@ func (c *Config) parseHours() (start, end int, err error) {
if c.UploadHours == "" {
return
}
ps := strings.Split(c.UploadHours, ",")
split := ","
if strings.Contains(c.UploadHours, "-") {
split = "-"
}
ps := strings.Split(c.UploadHours, split)
if len(ps) != 2 {
err = errors.New("unexpected number of fields")
return
Expand Down

0 comments on commit 74a0890

Please sign in to comment.