← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:gunicorn-scandir into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:gunicorn-scandir into launchpad:master.

Commit message:
Speed up gunicorn startup using scandir.walk

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/404414

The rest of Launchpad already uses this (see https://code.launchpad.net/~cjwatson/launchpad/scandir/+merge/345139).
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:gunicorn-scandir into launchpad:master.
diff --git a/configs/development/gunicorn.conf.py b/configs/development/gunicorn.conf.py
index 2c914aa..0576e0d 100644
--- a/configs/development/gunicorn.conf.py
+++ b/configs/development/gunicorn.conf.py
@@ -1,6 +1,8 @@
 from fnmatch import fnmatch
 import os
 
+import scandir
+
 
 BASE_DIR = os.path.realpath(
     os.path.join(os.path.dirname(__file__), '..', '..'))
@@ -11,7 +13,7 @@ def find_files(directory, pattern):
     """Find files in `directory` matching `pattern`.
     """
     result = []
-    for root, dirs, files in os.walk(directory):
+    for root, dirs, files in scandir.walk(directory):
         for basename in files:
             matches = fnmatch(basename, pattern)
             if matches: