Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions foundation/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,18 @@ func (r *Application) Start() {
go func() {
runner.running.Store(true)
if err := runner.runner.Run(); err != nil {
runner.doneOnce.Do(func() {
r.runnerWg.Done()
})
runner.running.Store(false)
errsMu.Lock()
defer errsMu.Unlock()

errs = append(errs, fmt.Errorf("failed to run %s: %w", runner.signature, err))
errsMu.Unlock()
if log := r.MakeLog(); log != nil {
log.Errorf("failed to run %s: %v\n", runner.signature, err)
}

runner.doneOnce.Do(func() {
r.runnerWg.Done()
})
r.cancel()
}
// Run may be a blocking call, so don't write anything after it.
Expand Down
Loading