From 21a7cb405c82c850db475e2410fba4015fc605b4 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 29 Mar 2024 23:28:59 +0100 Subject: [PATCH] check: replace cleanup handler --- cmd/restic/cmd_check.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 7bea641ae..83ebf89a6 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -199,10 +199,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args } cleanup := prepareCheckCache(opts, &gopts) - AddCleanupHandler(func(code int) (int, error) { - cleanup() - return code, nil - }) + defer cleanup() if !gopts.NoLock { Verbosef("create exclusive lock for repository\n")