summaryrefslogtreecommitdiffstats
path: root/pkg/gui/background.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-04-14 20:06:25 +0200
committerStefan Haller <stefan@haller-berlin.de>2024-04-18 10:10:30 +0200
commit1869fda8006731ecc15b748028ce1b9742a4c756 (patch)
treef4f3793d6bcd55d14db39c6919c943b30a0848a6 /pkg/gui/background.go
parent5396a706611220077d32d01058d5e4b025eab0de (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.go3
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