fix(project): don't abort early on project restore_state

And add traces for project write_state/restore_state.
This commit is contained in:
CJ van den Berg 2025-01-26 15:32:01 +01:00
parent 7ecdc38fdf
commit a1df51a16c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 26 additions and 10 deletions

View file

@ -607,6 +607,7 @@ const Process = struct {
}
fn persist_project(self: *Process, project: *Project) !void {
tp.trace(tp.channel.event, .{ "persist_project", project.name });
self.logger.print("saving: {s}", .{project.name});
const file_name = try get_project_state_file_path(self.allocator, project);
defer self.allocator.free(file_name);
@ -618,6 +619,7 @@ const Process = struct {
}
fn restore_project(self: *Process, project: *Project) !void {
tp.trace(tp.channel.event, .{ "restore_project", project.name });
const file_name = try get_project_state_file_path(self.allocator, project);
defer self.allocator.free(file_name);
var file = std.fs.openFileAbsolute(file_name, .{ .mode = .read_only }) catch |e| switch (e) {