Skip to content

Commit

Permalink
remove path resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Sep 10, 2024
1 parent f271296 commit 6916d66
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/servestatic/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ def scantree(root):
yield entry.path, entry.stat()


def stat_files(paths, path_resolver=lambda path: path) -> dict:
def stat_files(paths) -> dict:
"""Stat all files in `relative_paths` via threads."""

with concurrent.futures.ThreadPoolExecutor() as executor:
futures = {
rel_path: executor.submit(os.stat, path_resolver(rel_path))
for rel_path in paths
}
futures = {rel_path: executor.submit(os.stat, rel_path) for rel_path in paths}
return {rel_path: future.result() for rel_path, future in futures.items()}


Expand Down

0 comments on commit 6916d66

Please sign in to comment.