Commit 4163278e authored by Adrian Sutton's avatar Adrian Sutton

op-node: Improve CLI usage and inline err check

parent 3d19b6d2
......@@ -63,7 +63,7 @@ var (
}
RPCAdminPersistence = &cli.StringFlag{
Name: "rpc.admin-state",
Usage: "File path used to persist state changes made via the admin API so they persist across restarts",
Usage: "File path used to persist state changes made via the admin API so they persist across restarts. Disabled if not set.",
EnvVars: prefixEnvVars("RPC_ADMIN_STATE"),
}
L1TrustRPC = &cli.BoolFlag{
......
......@@ -71,8 +71,7 @@ func (p *ActiveConfigPersistence) persist(sequencerStarted bool) error {
return fmt.Errorf("open file (%v) for writing: %w", tmpFile, err)
}
defer file.Close() // Ensure file is closed even if write or sync fails
_, err = file.Write(data)
if err != nil {
if _, err = file.Write(data); err != nil {
return fmt.Errorf("write new config to temp file (%v): %w", tmpFile, err)
}
if err := file.Sync(); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment