From 7558e9d3c374b00fbb20c119cd0bca98db83efb3 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 1 Nov 2020 21:07:38 +0100 Subject: [PATCH] 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 --- web/api/v1/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/api/v1/api.go b/web/api/v1/api.go index ea4a2c3b1..45669f69c 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -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 {