mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
API: Make snapshot length always the same size (#8138)
Fixes #8135 Minor improvement, also we now use Int64 even on 32 bit systems. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
63be30dcee
commit
7558e9d3c3
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user