Skip to content

Commit f25f97e

Browse files
author
boonhapus
committed
increase time in between checks
1 parent d52d027 commit f25f97e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cs_tools/api/workflows/metadata.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,15 @@ async def tml_import(
390390

391391
async_job_id = d["task_id"]
392392

393-
# AFTER TEN 1-second ITERATIONS, WE'LL ELEVATE THE LOGGING LEVEL.
393+
# AFTER FIVE 5-second ITERATIONS (25s), WE'LL ELEVATE THE LOGGING LEVEL.
394394
n_iterations = 0
395395

396396
# OTHERWISE, PROCESS THE JOB AS IF IT WERE A SYNCHRONOUS PAYLOAD.
397397
while d.get("task_status") != "COMPLETED":
398-
log_level = logging.DEBUG if n_iterations < 10 else logging.INFO
398+
log_level = logging.DEBUG if n_iterations < 5 else logging.INFO
399399
n_iterations += 1
400400
_LOG.log(log_level, f"Checking status of asynchronous import {async_job_id}")
401-
_ = await asyncio.sleep(1) # type: ignore[func-returns-value]
401+
_ = await asyncio.sleep(5) # type: ignore[func-returns-value]
402402
r = await http.metadata_tml_async_status(task_ids=[async_job_id])
403403
r.raise_for_status()
404404

@@ -412,6 +412,7 @@ async def tml_import(
412412

413413
# POST-PROCESSING TO MIMIC THE SYNCHRONOUS RESPONSE.
414414
d = d["import_response"]["object"]
415+
415416
else:
416417
r = await http.metadata_tml_import(tmls=[t.dumps() for t in tmls], policy=policy, **tml_import_options)
417418
r.raise_for_status()

0 commit comments

Comments
 (0)