Skip to content

Commit

Permalink
Do not hide git error messages (gopasspw#2118)
Browse files Browse the repository at this point in the history
Fixes gopasspw#1959

RELEASE_NOTES=[BUGFIX] Do not hide git error messages
  • Loading branch information
dominikschulz authored Jan 17, 2022
1 parent 3f4878f commit 59da5f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/queue/background.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"time"

"github.com/gopasspw/gopass/internal/out"
"github.com/gopasspw/gopass/pkg/debug"
)

Expand Down Expand Up @@ -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")
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 59da5f0

Please sign in to comment.