From 59da5f031ab85576c98fb34a844f9ec636416dc8 Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Mon, 17 Jan 2022 21:35:30 +0100 Subject: [PATCH] Do not hide git error messages (#2118) Fixes #1959 RELEASE_NOTES=[BUGFIX] Do not hide git error messages --- internal/queue/background.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/queue/background.go b/internal/queue/background.go index 82610406f8..750590a9f5 100644 --- a/internal/queue/background.go +++ b/internal/queue/background.go @@ -12,6 +12,7 @@ import ( "fmt" "time" + "github.com/gopasspw/gopass/internal/out" "github.com/gopasspw/gopass/pkg/debug" ) @@ -81,7 +82,7 @@ func New(ctx context.Context) *Queue { func (q *Queue) run(ctx context.Context) { for t := range q.work { if err := t(ctx); err != nil { - debug.Log("Task failed: %s", err) + out.Errorf(ctx, "Task failed: %s", err) } debug.Log("Task done") } @@ -102,7 +103,12 @@ func (q *Queue) Idle(maxWait time.Duration) error { go func() { for { if len(q.work) < 1 { - done <- struct{}{} + select { + case done <- struct{}{}: + // sent + default: + // no-op + } } time.Sleep(20 * time.Millisecond) }