Skip to content

Commit d112e20

Browse files
Merge pull request #776 from imjaroiswebdev/revert-add-remaining-delays-for-retries
[CSGI-2263] Revert add remaining delays for retries
2 parents ce6be91 + 5a982b8 commit d112e20

28 files changed

+6
-174
lines changed

pagerduty/data_source_pagerduty_event_orchestration.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ func dataSourcePagerDutyEventOrchestrationRead(d *schema.ResourceData, meta inte
7474
return resource.NonRetryableError(err)
7575
}
7676

77-
// Delaying retry by 30s as recommended by PagerDuty
78-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
79-
time.Sleep(30 * time.Second)
8077
return resource.RetryableError(err)
8178
}
8279

@@ -99,9 +96,6 @@ func dataSourcePagerDutyEventOrchestrationRead(d *schema.ResourceData, meta inte
9996
// since the list ndpoint does not return it
10097
orch, _, err := client.EventOrchestrations.Get(found.ID)
10198
if err != nil {
102-
// Delaying retry by 30s as recommended by PagerDuty
103-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
104-
time.Sleep(30 * time.Second)
10599
return resource.RetryableError(err)
106100
}
107101

pagerduty/data_source_pagerduty_event_orchestrations.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ func dataSourcePagerDutyEventOrchestrationsRead(d *schema.ResourceData, meta int
9191
return resource.NonRetryableError(err)
9292
}
9393

94-
time.Sleep(10 * time.Second)
9594
return resource.RetryableError(err)
9695
}
9796

@@ -126,7 +125,6 @@ func dataSourcePagerDutyEventOrchestrationsRead(d *schema.ResourceData, meta int
126125
return resource.NonRetryableError(err)
127126
}
128127

129-
time.Sleep(10 * time.Second)
130128
return resource.RetryableError(err)
131129
}
132130
orchestrations = append(orchestrations, orch)

pagerduty/resource_pagerduty_automation_actions_action.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ func resourcePagerDutyAutomationActionsActionDelete(d *schema.ResourceData, meta
344344
return resource.NonRetryableError(err)
345345
}
346346

347-
// Delaying retry by 30s as recommended by PagerDuty
348-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
349-
time.Sleep(30 * time.Second)
350347
return resource.RetryableError(err)
351348
}
352349
return nil

pagerduty/resource_pagerduty_automation_actions_action_service_association.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ func resourcePagerDutyAutomationActionsActionServiceAssociationDelete(d *schema.
120120
return resource.NonRetryableError(err)
121121
}
122122

123-
// Delaying retry by 30s as recommended by PagerDuty
124-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
125-
time.Sleep(30 * time.Second)
126123
return resource.RetryableError(err)
127124
}
128125
return nil

pagerduty/resource_pagerduty_automation_actions_action_team_association.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ func resourcePagerDutyAutomationActionsActionTeamAssociationDelete(d *schema.Res
124124
return resource.NonRetryableError(err)
125125
}
126126

127-
// Delaying retry by 30s as recommended by PagerDuty
128-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
129-
time.Sleep(30 * time.Second)
130127
return resource.RetryableError(err)
131128
}
132129
return nil

pagerduty/resource_pagerduty_automation_actions_runner.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ func resourcePagerDutyAutomationActionsRunnerDelete(d *schema.ResourceData, meta
206206
return resource.NonRetryableError(err)
207207
}
208208

209-
// Delaying retry by 30s as recommended by PagerDuty
210-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
211-
time.Sleep(30 * time.Second)
212209
return resource.RetryableError(err)
213210
}
214211
return nil

pagerduty/resource_pagerduty_automation_actions_runner_team_association.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ func resourcePagerDutyAutomationActionsRunnerTeamAssociationDelete(d *schema.Res
120120
return resource.NonRetryableError(err)
121121
}
122122

123-
// Delaying retry by 30s as recommended by PagerDuty
124-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
125-
time.Sleep(30 * time.Second)
126123
return resource.RetryableError(err)
127124
}
128125
return nil

pagerduty/resource_pagerduty_business_service.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ func resourcePagerDutyBusinessServiceCreate(d *schema.ResourceData, meta interfa
107107
}
108108
log.Printf("[INFO] Creating PagerDuty business service %s", businessService.Name)
109109
if businessService, _, err = client.BusinessServices.Create(businessService); err != nil {
110-
// Delaying retry by 30s as recommended by PagerDuty
111-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
112-
time.Sleep(30 * time.Second)
113110
return resource.RetryableError(err)
114111
} else if businessService != nil {
115112
d.SetId(businessService.ID)
@@ -138,9 +135,6 @@ func resourcePagerDutyBusinessServiceRead(d *schema.ResourceData, meta interface
138135
return resource.NonRetryableError(err)
139136
}
140137

141-
// Delaying retry by 30s as recommended by PagerDuty
142-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
143-
time.Sleep(30 * time.Second)
144138
return resource.RetryableError(err)
145139
} else if businessService != nil {
146140
d.Set("name", businessService.Name)

pagerduty/resource_pagerduty_business_service_subscriber.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ func resourcePagerDutyBusinessServiceSubscriberCreate(d *schema.ResourceData, me
7070

7171
log.Printf("[INFO] Creating PagerDuty business service %s subscriber %s type %s", businessServiceId, businessServiceSubscriber.ID, businessServiceSubscriber.Type)
7272
if _, err = client.BusinessServiceSubscribers.Create(businessServiceId, businessServiceSubscriber); err != nil {
73-
// Delaying retry by 30s as recommended by PagerDuty
74-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
75-
time.Sleep(30 * time.Second)
7673
return resource.RetryableError(err)
7774
} else if businessServiceSubscriber != nil {
7875
// create subscriber assignment it as PagerDuty API does not return one

pagerduty/resource_pagerduty_escalation_policy.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ func resourcePagerDutyEscalationPolicyUpdate(d *schema.ResourceData, meta interf
198198

199199
retryErr := resource.Retry(5*time.Minute, func() *resource.RetryError {
200200
if _, _, err := client.EscalationPolicies.Update(d.Id(), escalationPolicy); err != nil {
201-
// Delaying retry by 30s as recommended by PagerDuty
202-
// https://developer.pagerduty.com/docs/rest-api-v2/rate-limiting/#what-are-possible-workarounds-to-the-events-api-rate-limit
203-
time.Sleep(30 * time.Second)
204201
return resource.RetryableError(err)
205202
}
206203
return nil
@@ -225,7 +222,6 @@ func resourcePagerDutyEscalationPolicyDelete(d *schema.ResourceData, meta interf
225222
retryErr := resource.Retry(30*time.Second, func() *resource.RetryError {
226223
if _, err := client.EscalationPolicies.Delete(d.Id()); err != nil {
227224
if isErrCode(err, 400) {
228-
time.Sleep(10 * time.Second)
229225
return resource.RetryableError(err)
230226
}
231227

0 commit comments

Comments
 (0)