File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import sys
3
- import asyncio
3
+ import time
4
4
import tempfile
5
- import aiofiles
6
5
from typing import Dict
7
6
from metaflow import Run
8
7
from metaflow .cli import start
9
8
from metaflow .click_api import MetaflowAPI
10
9
from metaflow .subprocess_manager import SubprocessManager , CommandManager
11
10
12
11
13
- async def read_from_file_when_ready (file_path ):
14
- async with aiofiles . open (file_path , "r" ) as file_pointer :
15
- content = await file_pointer .read ()
12
+ def read_from_file_when_ready (file_path ):
13
+ with open (file_path , "r" ) as file_pointer :
14
+ content = file_pointer .read ()
16
15
while not content :
17
- await asyncio .sleep (0.1 )
18
- content = await file_pointer .read ()
16
+ time .sleep (0.1 )
17
+ content = file_pointer .read ()
19
18
return content
20
19
21
20
@@ -71,8 +70,8 @@ async def run(self, **kwargs):
71
70
)
72
71
command_obj = self .spm .get (pid )
73
72
74
- flow_name = await read_from_file_when_ready (tfp_flow .name )
75
- run_id = await read_from_file_when_ready (tfp_run_id .name )
73
+ flow_name = read_from_file_when_ready (tfp_flow .name )
74
+ run_id = read_from_file_when_ready (tfp_run_id .name )
76
75
77
76
pathspec_components = (flow_name , run_id )
78
77
run_object = Run ("/" .join (pathspec_components ), _namespace_check = False )
You can’t perform that action at this time.
0 commit comments