Skip to content

Commit

Permalink
API: Make snapshot length always the same size (prometheus#8138)
Browse files Browse the repository at this point in the history
Fixes prometheus#8135

Minor improvement, also we now use Int64 even on 32 bit systems.

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie authored Nov 1, 2020
1 parent 63be30d commit 7558e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,9 @@ func (api *API) snapshot(r *http.Request) apiFuncResult {

var (
snapdir = filepath.Join(api.dbDir, "snapshots")
name = fmt.Sprintf("%s-%x",
name = fmt.Sprintf("%s-%016x",
time.Now().UTC().Format("20060102T150405Z0700"),
rand.Int())
rand.Int63())
dir = filepath.Join(snapdir, name)
)
if err := os.MkdirAll(dir, 0777); err != nil {
Expand Down

0 comments on commit 7558e9d

Please sign in to comment.