Skip to content

Commit

Permalink
yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
romilbhardwaj committed Apr 7, 2022
1 parent 4af5a7a commit bbe678b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/stress/mountedstorage/read_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def parse_args():
import argparse
parser = argparse.ArgumentParser(description='Recursively read in parallel')
parser.add_argument('path', help='Path to directory to read files;')
parser.add_argument('--list', action='store_true',
parser.add_argument('--list',
action='store_true',
help='List files before reading')
args = parser.parse_args()
return args
Expand Down Expand Up @@ -51,8 +52,10 @@ def read_parallel(path):
done = 0
for root, dirs, files in os.walk(path): # Uses a generator
with ThreadPoolExecutor(max_workers=64) as executor:
futures = [executor.submit(read_file, os.path.join(root, file)) for
file in files]
futures = [
executor.submit(read_file, os.path.join(root, file))
for file in files
]
for future in as_completed(futures):
done += 1
if done % 10 == 0:
Expand Down

0 comments on commit bbe678b

Please sign in to comment.