CI: fix CI await feature

This commit is contained in:
Max K 2024-06-05 10:21:00 +02:00
parent 4639b108e7
commit 418911c7d7

View File

@ -701,7 +701,6 @@ class CiCache:
len(self.jobs_to_wait) > MAX_JOB_NUM_TO_WAIT len(self.jobs_to_wait) > MAX_JOB_NUM_TO_WAIT
and round_cnt < MAX_ROUNDS_TO_WAIT and round_cnt < MAX_ROUNDS_TO_WAIT
): ):
await_finished: Set[str] = set()
round_cnt += 1 round_cnt += 1
GHActions.print_in_group( GHActions.print_in_group(
f"Wait pending jobs, round [{round_cnt}/{MAX_ROUNDS_TO_WAIT}]:", f"Wait pending jobs, round [{round_cnt}/{MAX_ROUNDS_TO_WAIT}]:",
@ -713,6 +712,7 @@ class CiCache:
expired_sec = 0 expired_sec = 0
start_at = int(time.time()) start_at = int(time.time())
while expired_sec < TIMEOUT and self.jobs_to_wait: while expired_sec < TIMEOUT and self.jobs_to_wait:
await_finished: Set[str] = set()
time.sleep(poll_interval_sec) time.sleep(poll_interval_sec)
self.update() self.update()
for job_name, job_config in self.jobs_to_wait.items(): for job_name, job_config in self.jobs_to_wait.items():
@ -759,11 +759,6 @@ class CiCache:
print( print(
f"...awaiting continues... seconds left [{TIMEOUT - expired_sec}]" f"...awaiting continues... seconds left [{TIMEOUT - expired_sec}]"
) )
if await_finished:
GHActions.print_in_group(
f"Finished jobs, round [{round_cnt}]: [{list(await_finished)}]",
list(await_finished),
)
GHActions.print_in_group( GHActions.print_in_group(
"Remaining jobs:", "Remaining jobs:",