File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
services/storage/src/simcore_service_storage/api/_worker_tasks Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 99from ...dsm import get_dsm_provider
1010from ...modules .celery .utils import get_celery_worker_client , get_fastapi_app
1111from ...simcore_s3_dsm import SimcoreS3DataManager
12- from ._tqdm_utils import get_export_progress , set_absolute_progress
12+ from ._progress_utils import get_tqdm_progress , set_tqdm_absolute_progress
1313
1414_logger = logging .getLogger (__name__ )
1515
@@ -29,10 +29,10 @@ async def data_export(
2929 ),
3030 )
3131
32- with get_export_progress (total = 1 , description = f"{ task .name } " ) as pbar :
32+ with get_tqdm_progress (total = 1 , description = f"{ task .name } " ) as pbar :
3333
3434 async def _progress_cb (report : ProgressReport ) -> None :
35- set_absolute_progress (pbar , current_progress = report . actual_value )
35+ set_tqdm_absolute_progress (pbar , report )
3636 await get_celery_worker_client (task .app ).set_task_progress (task , report )
3737
3838 return await dsm .create_s3_export (
Original file line number Diff line number Diff line change 11from typing import Final
22
3+ from models_library .progress_bar import ProgressReport
34from pydantic import NonNegativeFloat
45from tqdm import tqdm
56
1314}
1415
1516
16- def get_export_progress (total : NonNegativeFloat , * , description : str ) -> tqdm :
17+ def get_tqdm_progress (total : NonNegativeFloat , * , description : str ) -> tqdm :
1718 return tqdm (** TQDM_EXPORT_OPTIONS , total = total , desc = description )
1819
1920
20- def set_absolute_progress (pbar : tqdm , * , current_progress : NonNegativeFloat ) -> None :
21+ def set_tqdm_absolute_progress (pbar : tqdm , report : ProgressReport ) -> None :
2122 """used when the progress does not come in chunk by chunk but as the total current value"""
22- pbar .n = current_progress
23+ pbar .n = report . actual_value
2324 pbar .refresh ()
You can’t perform that action at this time.
0 commit comments