diff --git a/doc/changes.rst b/doc/changes.rst index 24609ec..b2305ca 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -5,7 +5,7 @@ Change Log 1.0.3 (unreleased) ------------------ -* No changes yet. +* Convert Tucson transfer to parallel operation. 1.0.2 (2024-06-21) ------------------ diff --git a/py/desitransfer/test/test_tucson.py b/py/desitransfer/test/test_tucson.py index bebc47a..b781bc7 100644 --- a/py/desitransfer/test/test_tucson.py +++ b/py/desitransfer/test/test_tucson.py @@ -196,4 +196,3 @@ def test_get_proc(self, mock_log, mock_popen): self.assertEqual(d, 'i') proc, LOG_J, d = _get_proc(directories, exclude, '/src', '/dst', options) self.assertIsNone(proc) - diff --git a/py/desitransfer/tucson.py b/py/desitransfer/tucson.py index 4904f5c..b3df778 100644 --- a/py/desitransfer/tucson.py +++ b/py/desitransfer/tucson.py @@ -131,7 +131,7 @@ def _options(): default=os.path.join(os.environ['HOME'], 'Documents', 'Logfiles'), help='Use DIR for log files (default %(default)s).') prsr.add_argument('-p', '--processes', action='store', type=int, - dest='nproc', metavar="N", default=10, + dest='nproc', metavar="N", default=10, help="Number of simultaneous downloads (default %(default)s).") prsr.add_argument('-s', '--static', action='store_true', dest='static', help='Also sync static data sets.') @@ -327,6 +327,8 @@ def main(): LOG.close() if status != 0: log.critical("rsync error detected for %s/%s/! Check logs!", dst, d) - proc_pool[proc_key] = _get_proc(directories, exclude, src, dst, options) - time.sleep(sleepy_time) + proc_pool[proc_key] = _get_proc(directories, exclude, src, dst, options) + if not options.test: + log.debug("Waiting for jobs to complete, sleeping %s.", options.sleep) + time.sleep(sleepy_time) return 0