mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 22:40:31 -05:00
diagnostics: Persist UUID in string format for convenience
This commit is contained in:
parent
6b3c2212a1
commit
5820356cf6
1 changed files with 2 additions and 2 deletions
|
@ -296,7 +296,7 @@ func initDiagnostics() {
|
|||
|
||||
newUUID := func() uuid.UUID {
|
||||
id := uuid.New()
|
||||
err := ioutil.WriteFile(uuidFilename, id[:], 0644)
|
||||
err := ioutil.WriteFile(uuidFilename, []byte(id.String()), 0644) // human-readable this way
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Persisting instance UUID: %v", err)
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ func initDiagnostics() {
|
|||
log.Printf("[ERROR] Reading persistent UUID: %v", err)
|
||||
id = newUUID()
|
||||
} else {
|
||||
id, err = uuid.FromBytes(uuidBytes)
|
||||
id, err = uuid.ParseBytes(uuidBytes)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Parsing UUID: %v", err)
|
||||
id = newUUID()
|
||||
|
|
Loading…
Reference in a new issue