From 4cdbaed218bb559433694aaf20f11ef8d2d3695c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Reyes?= Date: Thu, 2 Nov 2023 17:06:31 -0300 Subject: [PATCH] update retry delay for service state read --- pagerduty/resource_pagerduty_service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pagerduty/resource_pagerduty_service.go b/pagerduty/resource_pagerduty_service.go index f4aa870e6..96ca3f680 100644 --- a/pagerduty/resource_pagerduty_service.go +++ b/pagerduty/resource_pagerduty_service.go @@ -418,7 +418,9 @@ func fetchService(d *schema.ResourceData, meta interface{}, errCallback func(err errResp := errCallback(err, d) if errResp != nil { - time.Sleep(2 * time.Second) + // Delaying retry by 30s as recommended by PagerDuty + // https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit + time.Sleep(30 * time.Second) return resource.RetryableError(errResp) }