Browse Source

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>
pull/8142/head
Julien Pivotto 4 years ago committed by GitHub
parent
commit
7558e9d3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      web/api/v1/api.go

4
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 {

Loading…
Cancel
Save