Skip to content

Commit

Permalink
refactor test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Aug 20, 2024
1 parent b3aea4d commit a0dd88d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions py/desitransfer/tucson.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,17 @@ def main():
while any([v[0] is not None for v in proc_pool.values()]):
for proc_key in proc_pool:
proc, LOG, d = proc_pool[proc_key]
if options.test and proc is not None:
log.debug("%s: %s -> %s", d, ' '.join(proc), LOG)
if proc is None:
status = None
else:
status = proc.poll()
if options.test:
log.debug("%s: %s -> %s", d, ' '.join(proc), LOG)
status = 0
else:
status = proc.poll()
if status is not None:
LOG.close()
if not options.test:
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)
Expand Down

0 comments on commit a0dd88d

Please sign in to comment.