in app/pubsub-integration/pubsub/pubsub.go [44:68]
func NewClientBackoffConfig(initial time.Duration, max time.Duration) *pubsub.ClientConfig {
// initial: the initial value of the retry period
// max: the maximum value of the retry period
retryer := func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Aborted,
codes.Canceled,
codes.Internal,
codes.ResourceExhausted,
codes.Unknown,
codes.Unavailable,
codes.DeadlineExceeded,
}, gax.Backoff{
Initial: initial,
Max: max,
})
}
return &pubsub.ClientConfig{
PublisherCallOptions: &vkit.PublisherCallOptions{
Publish: []gax.CallOption{gax.WithRetry(retryer)},
},
}
}