From 94722941cfab4f79ba71e98c2ff9349e259859dd Mon Sep 17 00:00:00 2001 From: David Dworken Date: Wed, 9 Nov 2022 15:07:00 -0800 Subject: [PATCH] Make control-r faster by not blocking on processing pending deletion requests. Fixed #22 --- client/lib/tui.go | 6 ++++++ hishtory.go | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/lib/tui.go b/client/lib/tui.go index b1f5e3c..0c7d33f 100644 --- a/client/lib/tui.go +++ b/client/lib/tui.go @@ -406,6 +406,12 @@ func TuiQuery(ctx *context.Context, gitCommit, initialQuery string) error { } p.Send(doneDownloadingMsg{}) }() + go func() { + err := ProcessDeletionRequests(ctx) + if err != nil { + p.Send(err) + } + }() go func() { banner, err := GetBanner(ctx, gitCommit) if err != nil { diff --git a/hishtory.go b/hishtory.go index 97ac826..d5a9ebf 100644 --- a/hishtory.go +++ b/hishtory.go @@ -35,7 +35,6 @@ func main() { query(ctx, strings.Join(os.Args[2:], " ")) case "tquery": ctx := hctx.MakeContext() - lib.CheckFatalError(lib.ProcessDeletionRequests(ctx)) lib.CheckFatalError(lib.TuiQuery(ctx, GitCommit, strings.Join(os.Args[2:], " "))) case "export": ctx := hctx.MakeContext()