From 7f9e2d2dd6fb21dbc76974623f09b948d8c73651 Mon Sep 17 00:00:00 2001 From: Jimil Desai Date: Thu, 15 Jun 2023 15:47:06 +0200 Subject: [PATCH] wait for the job to start Signed-off-by: Jimil Desai --- jobs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jobs.py b/jobs.py index d3fdb91..ae994f9 100644 --- a/jobs.py +++ b/jobs.py @@ -54,6 +54,7 @@ def backup(bucket_name): # list all running "backup" jobs running_jobs = [job for job in jobs if job.status.active is not None] + print("running jobs: ") for j in running_jobs: print(j.metadata.name) # list all completed jobs @@ -236,7 +237,9 @@ def backup(bucket_name): backoff_limit=0, ), ) + # wait until the job is created batchAPI.create_namespaced_job(namespace=os.environ["NAMESPACE"], body=job) + time.sleep(2) page_num += 1