Print a proper message for finished awaiting

This commit is contained in:
Mikhail f. Shiryaev 2024-11-05 13:37:35 +01:00
parent d43329f254
commit ccaa66963d
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -845,11 +845,12 @@ class CiCache:
del self.jobs_to_wait[job]
if not dry_run:
# Avoid `seconds left [-3]`
expired_sec = min(int(time.time() - start_at), TIMEOUT)
print(
f"...awaiting continues... seconds left [{TIMEOUT - expired_sec}]"
)
expired_sec = int(time.time() - start_at)
msg = f"...awaiting continues... seconds left [{TIMEOUT - expired_sec}]"
if expired_sec >= TIMEOUT:
# Avoid `seconds left [-3]`
msg = f"awaiting for round {round_cnt} is finished"
print(msg)
else:
# make up for 2 iterations in dry_run
expired_sec += int(TIMEOUT / 2) + 1