mirror of https://github.com/hashicorp/consul
guard the conversion
parent
0956e061b6
commit
ed9709a578
|
@ -4669,12 +4669,15 @@ func (a *Agent) persistServerMetadata() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
sf := f.(*safeio.File)
|
// Use safeio.File to ensure the file is written to disk atomically
|
||||||
if err := sf.Commit(); err != nil {
|
if sf, ok := f.(*safeio.File); ok {
|
||||||
a.logger.Error("failed to commit server metadata", "error", err)
|
if err := sf.Commit(); err != nil {
|
||||||
continue
|
sf.Close()
|
||||||
|
a.logger.Error("failed to commit server metadata", "error", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sf.Close()
|
f.Close()
|
||||||
case <-a.shutdownCh:
|
case <-a.shutdownCh:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue