Skip to content

Commit afeb448

Browse files
authored
Update resource_port_check_v2.go
1 parent dba0de3 commit afeb448

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

synthetics/resource_port_check_v2.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,15 @@ func resourcePortCheckV2Read(ctx context.Context, d *schema.ResourceData, meta i
165165
}
166166

167167
o, r, err := c.GetPortCheckV2(checkID)
168+
169+
if err != nil || r.StatusCode == 404 || r.StatusCode == 0 {
170+
log.Println("[WARN] Synthetics API error. Retrying.", checkID, err.Error(), r.StatusCode, r.StatusCode)
171+
o, r, err = c.GetPortCheckV2(checkID)
172+
}
173+
168174
if err != nil && (err.Error() == "Status Code: 404 Not Found" || r.StatusCode == 0) {
169175
d.SetId("")
176+
log.Println("[WARN] Synthetics API error.", err.Error(), r.StatusCode, r.StatusCode)
170177
log.Println("[WARN] Resource exists in state but not in API. Removing resource from state.")
171178
return diags
172179
}

0 commit comments

Comments
 (0)