mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-06 08:17:42 -05:00
make delay only affect the step
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -75,9 +75,12 @@ func (pp *Postprocessing) CurrentStep() interface{} {
|
||||
}
|
||||
|
||||
// Delay will sleep the configured time then continue
|
||||
func (pp *Postprocessing) Delay() interface{} {
|
||||
time.Sleep(pp.config.Delayprocessing)
|
||||
return pp.next(events.PPStepDelay)
|
||||
func (pp *Postprocessing) Delay(f func(next interface{})) {
|
||||
next := pp.next(events.PPStepDelay)
|
||||
go func() {
|
||||
time.Sleep(pp.config.Delayprocessing)
|
||||
f(next)
|
||||
}()
|
||||
}
|
||||
|
||||
// BackoffDuration calculates the duration for exponential backoff based on the number of failures.
|
||||
|
||||
Reference in New Issue
Block a user