write jsonrpc2.yml atomically

8990c1f added writeFileAtomic, but only used it in
SignalCliApiConfig.Persist() (api-config.yml). jsonrpc2.yml is written
by JsonRpc2ClientConfig.Persist(), which still used ioutil.WriteFile,
so the REST API could still read an empty jsonrpc2.yml while
jsonrpc2-helper rewrites it and start without any JSON-RPC client.

see #893
This commit is contained in:
Serhii Horbatenko committed 2026-11-23 10:49:13 +02:00
1 parent f96aeea428
commit c49c986692
1 file changed
+1 -1
+1 -1
View File
@@ -69,5 +69,5 @@ func (c *JsonRpc2ClientConfig) Persist(path string) error {
return err
}
return ioutil.WriteFile(path, out, 0644)
return writeFileAtomic(path, out, 0644)
}