i have developed 2 python function scheduled into cloud run. The first function create on demand a job:
def google_cloud_create_job(job_uuid,payload_job,token):
try:
url = "https://us-central1-run.googleapis.com/v2/xxxxxxxxxxxxx/locations/us-central1/jobs?jobId=job-name-{0}&validateOnly=False".format(str(job_uuid))
payload = payload_job
headers = {
'Authorization': 'Bearer {}'.format(token),
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
return response.status_code
except Exception as e:
print(e)
The second function execute the job created:
def google_cloud_run_job(job_uuid, token):
url = "https://us-central1-run.googleapis.com/v2/xxxxxxxxxxxxxxxxxx/locations/us-central1/jobs/job-name-{0}:run".format(str(job_uuid))
print(url)
headers = {
'Authorization': 'Bearer {}'.format(token),
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers)
return response.status_code
Now when i execute this function to create and run 3 jobs, all works fine. If i add a 4° request to create a 4° jobs in sequence, the 4° job is created but not run, and the run function receive a status code response 429. My quota limit for cloud run admin api 'Job run requests per minute per region' is ten and if a do 4 request to create and 4 to run the total is 8, so i'm under quota limit. So Why this error? Any help? On google cloud community no response