13
0

Copy state files for backup, instead of serializing

This should speed up backup saves of large session files.
This commit is contained in:
Robin Gareus 2020-07-17 15:22:40 +02:00
parent 5ae0039e5b
commit 0b89d69de1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -925,10 +925,11 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
save_path += "-";
save_path += timebuf;
save_path += statefile_suffix;
if ( !tree.write (save_path) )
if (!copy_file (xml_path, save_path)) {
error << string_compose(_("Could not save backup file at path \"%1\" (%2)"),
save_path, g_strerror (errno)) << endmsg;
}
}
StateSaved (snapshot_name); /* EMIT SIGNAL */
}