Skip to content

Commit c4e841f

Browse files
authored
Merge pull request materials-data-facility#50 from materials-data-facility/interval
Adding support for variable download interval
2 parents d34e9f9 + 7a8f46b commit c4e841f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎mdf_forge/forge.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ def http_download(self, results, dest=".", preserve_dir=False, verbose=True):
650650
}
651651

652652
def globus_download(self, results, dest=".", dest_ep=None, preserve_dir=False,
653-
inactivity_time=None, download_datasets=False, verbose=True):
653+
inactivity_time=None, download_datasets=False, verbose=True,
654+
**kwargs):
654655
"""Download data files from the provided results using Globus Transfer.
655656
This method requires Globus Connect to be installed on the destination endpoint.
656657
@@ -681,8 +682,11 @@ def globus_download(self, results, dest=".", dest_ep=None, preserve_dir=False,
681682
verbose (bool): If ``True``, status and progress messages will be printed,
682683
and errors will prompt for continuation confirmation.
683684
If ``False``, only error messages will be printed,
684-
and the Transfer will always continue.
685-
**Default:** ``True``.
685+
and the Transfer will always
686+
687+
Keyword Arguments:
688+
interval (int): Time in seconds to wait between checking transfer status.
689+
**Default:** self.__transfer_interval
686690
687691
Returns:
688692
list of str: The task IDs of the Globus transfers.
@@ -785,8 +789,9 @@ def globus_download(self, results, dest=".", dest_ep=None, preserve_dir=False,
785789
failed = 0
786790
for task_ep, task_paths in tqdm(tasks.items(), desc="Transferring data",
787791
disable=(not verbose)):
792+
interval = kwargs.get('interval',self.__transfer_interval)
788793
transfer = mdf_toolbox.custom_transfer(self.__transfer_client, task_ep, dest_ep,
789-
task_paths, interval=self.__transfer_interval,
794+
task_paths, interval=interval,
790795
inactivity_time=inactivity_time)
791796
cont = True
792797
# Prime loop

0 commit comments

Comments
 (0)