From 8eb33b2fc0c838f55eb64244ec405ef95416c380 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 19 Apr 2025 21:29:48 +0900 Subject: [PATCH] cmd/rpcfetch: update replace counter in ui thread --- cmd/rpcfetch/apply.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/rpcfetch/apply.go b/cmd/rpcfetch/apply.go index 43e1da4..c8474c6 100644 --- a/cmd/rpcfetch/apply.go +++ b/cmd/rpcfetch/apply.go @@ -60,10 +60,8 @@ type applyState struct { func (s *applyState) replace(t string) string { for k, f := range substitute { t = strings.ReplaceAll(t, "%"+k, f(s)) - go func() { - replCounter.Add(uint64(len(t))) - statusReplaces.SetText(strconv.Itoa(int(replCounter.Load())) + " bytes") - }() + replCounter.Add(uint64(len(t))) + statusReplaces.SetText(strconv.Itoa(int(replCounter.Load())) + " bytes") } return t }