Skip to content

Commit

Permalink
Added some new checks for download complete validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed Aug 26, 2020
1 parent e242c3b commit e1d5a18
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions artella/plugins/getdependencies/getdependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def _get_dependencies(deps_file_path, parent_path=None, found_files=None):
# is being processed
time.sleep(1.0)

valid_download = True
if show_dialogs:
if qtutils.QT_AVAILABLE:
dcc_progress_bar = splash.ProgressSplashDialog()
Expand All @@ -143,6 +144,7 @@ def _get_dependencies(deps_file_path, parent_path=None, found_files=None):
while True:
if show_dialogs and dcc_progress_bar.is_cancelled():
artella_drive_client.pause_downloads()
valid_download = False
break
progress, fd, ft, bd, bt = artella_drive_client.get_progress()
progress_status = '{} of {} KiB downloaded\n{} of {} files downloaded'.format(
Expand All @@ -152,6 +154,17 @@ def _get_dependencies(deps_file_path, parent_path=None, found_files=None):
if progress >= 100 or bd == bt:
break

total_checks = 0
if valid_download:
missing_file = False
for local_file_path in files_to_download:
if not os.path.exists(local_file_path):
missing_file = True
break
while missing_file and total_checks < 5:
time.sleep(1.0)
total_checks += 1

if show_dialogs:
dcc_progress_bar.end()

Expand Down

0 comments on commit e1d5a18

Please sign in to comment.