From 8889e2df54b2f588065de959efeef1f4f7a25169 Mon Sep 17 00:00:00 2001 From: FIGBERT Date: Sun, 23 Jul 2023 14:45:58 +0300 Subject: [PATCH] Add debug logs to sync progress bar --- matrix/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matrix/sync.go b/matrix/sync.go index 7c1d879..0a7f41c 100644 --- a/matrix/sync.go +++ b/matrix/sync.go @@ -60,12 +60,15 @@ func (s *GomuksSyncer) ProcessResponse(res *mautrix.RespSync, since string) (err debug.Print("Received sync response") s.Progress.SetMessage("Processing sync response") steps := len(res.Rooms.Join) + len(res.Rooms.Invite) + len(res.Rooms.Leave) - s.Progress.SetSteps(steps + 2 + len(s.globalListeners)) + visualSteps := steps + 2 + len(s.globalListeners) + debug.Printf("[SYNC] Creating a progress bar with %s steps (%s rooms, %s global listeners)", visualSteps, steps, len(s.globalListeners)) + s.Progress.SetSteps(visualSteps) wait := &sync.WaitGroup{} callback := func() { wait.Done() s.Progress.Step() + debug.Print("[SYNC] Stepping progress bar") } wait.Add(len(s.globalListeners)) s.notifyGlobalListeners(res, since, callback)