REST API Groovy Script: "Error 429 - Too many requests" since Gen2 Migration
Summary:
Content (required):
I have a basic groovy script that runs a series of rules in sequence which all worked well in EPM classic.
The script basically runs through a list of requests and for each job, does a poll against the server to check the 'jobStatus' for a complete status (i.e. a value other than -1) before proceeding to the next task.
Since migrating to Gen2 I noticed a random occurrence of errors and managed to debug and narrow it down to the part where we do the checking of the job status.
HttpResponse<String> pingResponse for (long delay = 50; JobStatus == -1; delay = Math.min(1000, delay*2)) { //pause sleep(delay) pingResponse = operation.application.getConnection("DMJobs").get(restURL +"/"+ processID).asString() JobStatus = JsonPath.parse(pingResponse.body).read('$.status') }
Tagged:
0