src/bosh-softlayer-cpi/softlayer/client/swift_large_object.go
func (lo *largeObject) retryPutPart(part *part) {
	defer lo.wg.Done()
	var err error
	for i := 0; i < 3; i++ {
		time.Sleep(time.Duration(math.Exp2(float64(i))) * 100 * time.Millisecond) // exponential back-off
		err = lo.putPart(part)
		if err == nil {
			lo.bp.give <- part.b
			return
		}
		lo.logger.Error(swiftLargeObjectLogTag, fmt.Sprintf("Error on attempt %d: Retrying part: %v, Error: %s", i, part, err))
	}
	lo.err = err
}
func (lo *largeObject) retryPutPart(part *part) {
	defer lo.wg.Done()
	var err error
	for i := 0; i < 3; i++ {
		time.Sleep(time.Duration(math.Exp2(float64(i))) * 100 * time.Millisecond) // exponential back-off
		err = lo.putPart(part)
		if err == nil {
			lo.bp.give <- part.b
			return
		}
		lo.logger.Error(swiftLargeObjectLogTag, fmt.Sprintf("Error on attempt %d: Retrying part: %v, Error: %s", i, part, err))
	}
	lo.err = err
}
func ( lo * largeObject ) retryPutPart ( part * part ) { defer lo . wg . Done ( ) var err error for i := 0 ; i < 3 ; i ++ { time . Sleep ( time . Duration ( math . Exp2 ( float64 ( i ) ) ) * 100 * time . Millisecond ) // exponential back-off err = lo . putPart ( part ) if err == nil { lo . bp . give <- part . b return } lo . logger . Error ( swiftLargeObjectLogTag , fmt . Sprintf ( " " , i , part , err ) ) } lo . err = err }
// Calls putPart up to nTry times to recover from transient errors.
Calls putPart up to nTry times to recover from transient errors .