@@ -147,7 +147,7 @@ def download_bag(local, bag_id: str, download_all: bool = True):
147147 if not resp .json ()['ok' ]:
148148 local .add_log ("Error adding bag: " + resp .json (), "error" )
149149 return False
150- time .sleep (5 )
150+ time .sleep (3 )
151151 resp = requests .get (local_ts_url + f'/api/v1/details?bag_id={ bag_id } ' ).json ()
152152 while not resp ['completed' ]:
153153 if resp ['size' ] == 0 :
@@ -251,17 +251,17 @@ def download_archive_from_ts(local):
251251
252252 archive_dir = local .buffer .ton_db_dir + 'archive/'
253253 import_dir = local .buffer .ton_db_dir + 'import/'
254+ os .makedirs (import_dir , exist_ok = True )
254255 states_dir = archive_dir + '/states'
255256 downloads_path = '/tmp/ts-downloads/'
256257
257258 os .makedirs (states_dir , exist_ok = True )
258259 os .makedirs (import_dir , exist_ok = True )
259260
260- local .add_log ("Copying data to node db" , "info" )
261- subprocess .run (f'cp -a { downloads_path } /{ state_bag ["bag" ]} /state-*/* { states_dir } ' , shell = True )
261+ subprocess .run (f'mv { downloads_path } /{ state_bag ["bag" ]} /state-*/* { states_dir } ' , shell = True )
262262 # subprocess.run(['rm', '-rf', f"{downloads_path}/{state_bag['bag']}"])
263- for bag in block_bags :
264- subprocess .run (f'cp -a { downloads_path } /{ bag ["bag" ]} /packages { import_dir } ' , shell = True )
263+ for bag in block_bags + master_block_bags :
264+ subprocess .run (f'mv { downloads_path } /{ bag ["bag" ]} /packages/*/* { import_dir } ' , shell = True )
265265 # subprocess.run(['rm', '-rf', f"{downloads_path}/{bag['bag']}"])
266266 subprocess .run (['rm' , '-rf' , downloads_path ])
267267
0 commit comments