mirror of https://github.com/status-im/consul.git
Add a note about not calling sync for persistCheckState
This commit is contained in:
parent
e30b289c6f
commit
7a3e0f8275
|
@ -1100,6 +1100,7 @@ func (a *Agent) persistCheckState(check *CheckTTL, status, output string) error
|
||||||
// Create temp file in same dir, to make more likely atomic
|
// Create temp file in same dir, to make more likely atomic
|
||||||
tempFile := file + ".tmp"
|
tempFile := file + ".tmp"
|
||||||
|
|
||||||
|
// persistCheckState is called frequently, so don't use writeFileAtomic to avoid calling fsync here
|
||||||
if err := ioutil.WriteFile(tempFile, buf, 0600); err != nil {
|
if err := ioutil.WriteFile(tempFile, buf, 0600); err != nil {
|
||||||
return fmt.Errorf("failed writing temp file %q: %s", tempFile, err)
|
return fmt.Errorf("failed writing temp file %q: %s", tempFile, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue