Skip to content

Commit

Permalink
wait for the job to start
Browse files Browse the repository at this point in the history
Signed-off-by: Jimil Desai <[email protected]>
  • Loading branch information
jimil749 committed Jun 15, 2023
1 parent 14299c2 commit 7f9e2d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 7f9e2d2

Please sign in to comment.