Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5045bac92f |
+5
-6
@@ -207,7 +207,7 @@ func RunApp(ctx context.Context, app *fx.App) error {
|
|||||||
var errReported = errors.New("operation failed")
|
var errReported = errors.New("operation failed")
|
||||||
|
|
||||||
// errInterrupted marks an operation that SIGINT or SIGTERM stopped
|
// errInterrupted marks an operation that SIGINT or SIGTERM stopped
|
||||||
// before it finished. Entry shows it and returns exitCodeInterrupted.
|
// before it finished. Entry shows it and exits with exitCodeInterrupted.
|
||||||
var errInterrupted = errors.New("interrupted before the command finished")
|
var errInterrupted = errors.New("interrupted before the command finished")
|
||||||
|
|
||||||
// RunOperation runs op against the Vaultik instance inside the fx app
|
// RunOperation runs op against the Vaultik instance inside the fx app
|
||||||
@@ -300,11 +300,10 @@ func RunOperation(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunWithApp returns only after OnStop has waited for the goroutine
|
// The goroutine sets failed or interrupted before triggering the
|
||||||
// to return, whether the shutdown came from op finishing or from an
|
// shutdown that lets RunWithApp return, so the write is in place by
|
||||||
// interrupt, so the goroutine's write to failed or interrupted is in
|
// the time we read it. If OnStop timed out, the goroutine has not
|
||||||
// place by the time we read it. If OnStop timed out, the goroutine
|
// got that far, and OnStop has set interrupted itself.
|
||||||
// may still be running, and OnStop has set interrupted itself.
|
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user