all, vendor: Switch back to non-forked thejerf/suture (#5171)

This commit is contained in:
Jakob Borg
2018-09-08 11:56:56 +02:00
committed by Audrius Butkevicius
parent 8aa2d8d92c
commit 9e00b619ab
18 changed files with 47 additions and 44 deletions

View File

@@ -126,15 +126,15 @@ type Supervisor struct {
// Spec is used to pass arguments to the New function to create a
// supervisor. See the New function for full documentation.
type Spec struct {
Log func(string)
FailureDecay float64
FailureThreshold float64
FailureBackoff time.Duration
Timeout time.Duration
LogBadStop BadStopLogger
LogFailure FailureLogger
LogBackoff BackoffLogger
PanicPanics bool
Log func(string)
FailureDecay float64
FailureThreshold float64
FailureBackoff time.Duration
Timeout time.Duration
LogBadStop BadStopLogger
LogFailure FailureLogger
LogBackoff BackoffLogger
PassThroughPanics bool
}
/*
@@ -178,6 +178,9 @@ failure count to zero.
Timeout is how long Suture will wait for a service to properly terminate.
The PassThroughPanics options can be set to let panics in services propagate
and crash the program, should this be desirable.
*/
func New(name string, spec Spec) (s *Supervisor) {
s = new(Supervisor)
@@ -216,7 +219,7 @@ func New(name string, spec Spec) (s *Supervisor) {
} else {
s.timeout = spec.Timeout
}
s.recoverPanics = !spec.PanicPanics
s.recoverPanics = !spec.PassThroughPanics
// overriding these allows for testing the threshold behavior
s.getNow = time.Now