diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-04-14 20:06:25 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-04-18 10:10:30 +0200 |
commit | 1869fda8006731ecc15b748028ce1b9742a4c756 (patch) | |
tree | f4f3793d6bcd55d14db39c6919c943b30a0848a6 /pkg/gui/background.go | |
parent | 5396a706611220077d32d01058d5e4b025eab0de (diff) |
Make OnWorker callback return an error
This lets us get rid of a few more calls to Error(), and it simplifies things
for clients of OnWorker: they can simply return an error from their callback
like we do everywhere else.
Diffstat (limited to 'pkg/gui/background.go')
-rw-r--r-- | pkg/gui/background.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/gui/background.go b/pkg/gui/background.go index 342e3127e..db267c0dc 100644 --- a/pkg/gui/background.go +++ b/pkg/gui/background.go @@ -87,9 +87,10 @@ func (self *BackgroundRoutineMgr) goEvery(interval time.Duration, stop chan stru if self.pauseBackgroundRefreshes { continue } - self.gui.c.OnWorker(func(gocui.Task) { + self.gui.c.OnWorker(func(gocui.Task) error { _ = function() done <- struct{}{} + return nil }) // waiting so that we don't bunch up refreshes if the refresh takes longer than the interval <-done |