Skip to content

Commit 40a642e

Browse files
authored
remove the spin loop (#60)
I was going to build a more complex restart system that would recover from certain errors, but it's a lot more work so I'm skipping it for now.
1 parent 975266b commit 40a642e

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

service/service.go

+5-14
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,11 @@ func (app *App) Start(ctx context.Context) error {
131131
}()
132132
}
133133

134-
handle := func() error {
135-
select {
136-
case err := <-errs:
137-
return err
138-
case <-ctx.Done():
139-
return context.Canceled
140-
}
141-
}
142-
143-
zap.L().Debug("starting service main loop")
144-
for {
145-
if err := handle(); err != nil {
146-
return err
147-
}
134+
select {
135+
case err := <-errs:
136+
return err
137+
case <-ctx.Done():
138+
return context.Canceled
148139
}
149140
}
150141

0 commit comments

Comments
 (0)