diff --git a/src/irmin-pack/unix/gc.ml b/src/irmin-pack/unix/gc.ml index 1da61e67f6..dd63407128 100644 --- a/src/irmin-pack/unix/gc.ml +++ b/src/irmin-pack/unix/gc.ml @@ -285,8 +285,9 @@ module Make (Args : Gc_args.S) = struct let finalise_without_swap t = let* status = Async.await t.task in - match status with - | `Success -> + let gc_output = read_gc_output ~root:t.root ~generation:t.generation in + match (status, gc_output) with + | `Success, Ok _ -> Lwt.return (t.latest_gc_target_offset, t.new_suffix_start_offset) | _ -> let gc_output = read_gc_output ~root:t.root ~generation:t.generation in diff --git a/src/irmin-pack/unix/gc_worker.ml b/src/irmin-pack/unix/gc_worker.ml index 1700322258..5ab402e504 100644 --- a/src/irmin-pack/unix/gc_worker.ml +++ b/src/irmin-pack/unix/gc_worker.ml @@ -371,6 +371,7 @@ module Make (Args : Gc_args.S) = struct run ~generation ~new_files_path root commit_key new_suffix_start_offset) in + Errs.log_if_error "gc run" result; let write_result = write_gc_output ~root ~generation result in write_result |> Errs.log_if_error "writing gc output" (* No need to raise or log if [result] is [Error _], we've written it in diff --git a/src/irmin-pack/unix/io_errors.ml b/src/irmin-pack/unix/io_errors.ml index fd1dd736d6..2a3edd53ac 100644 --- a/src/irmin-pack/unix/io_errors.ml +++ b/src/irmin-pack/unix/io_errors.ml @@ -28,7 +28,7 @@ module type S = sig val log_error : string -> [< t ] -> unit val catch : (unit -> 'a) -> ('a, t) result val raise_if_error : ('a, [< t ]) result -> 'a - val log_if_error : string -> (unit, [< t ]) result -> unit + val log_if_error : string -> ('a, [< t ]) result -> unit end module Make (Io : Io.S) : S with module Io = Io = struct