aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-27 19:39:09 +0100
committerMichael Muré <batolettre@gmail.com>2022-12-27 19:39:09 +0100
commitb27958758fe59f3c984243f4ad3cb8bcb4f43e86 (patch)
treed04c5e9b3baf91a14c32aa742938ada718f07914 /commands
parent8cea6c7515e42cb8821a03c9bfebb0a8f63a01be (diff)
downloadgit-bug-b27958758fe59f3c984243f4ad3cb8bcb4f43e86.tar.gz
cache: simplify cache building events handling
Diffstat (limited to 'commands')
-rw-r--r--commands/execenv/env.go8
-rw-r--r--commands/webui.go5
2 files changed, 3 insertions, 10 deletions
diff --git a/commands/execenv/env.go b/commands/execenv/env.go
index d30a8db4..9b71a45a 100644
--- a/commands/execenv/env.go
+++ b/commands/execenv/env.go
@@ -129,15 +129,11 @@ func LoadBackend(env *Env) func(*cobra.Command, []string) error {
}
var events chan cache.BuildEvent
- env.Backend, events, err = cache.NewRepoCache(env.Repo)
- if err != nil {
- return err
- }
+ env.Backend, events = cache.NewRepoCache(env.Repo)
for event := range events {
if event.Err != nil {
- env.Err.Printf("Cache building error [%s]: %v\n", event.Typename, event.Err)
- continue
+ return event.Err
}
switch event.Event {
case cache.BuildEventCacheIsBuilt:
diff --git a/commands/webui.go b/commands/webui.go
index eca40b91..0b3b24a6 100644
--- a/commands/webui.go
+++ b/commands/webui.go
@@ -106,11 +106,8 @@ func runWebUI(env *execenv.Env, opts webUIOptions) error {
}
mrc := cache.NewMultiRepoCache()
- _, events, err := mrc.RegisterDefaultRepository(env.Repo)
- if err != nil {
- return err
- }
+ _, events := mrc.RegisterDefaultRepository(env.Repo)
for event := range events {
if event.Err != nil {
env.Err.Printf("Cache building error [%s]: %v\n", event.Typename, event.Err)