Skip to content

Commit 009d204

Browse files
committed
Pre-load imports and templates for wsgi
This triggers preloading once in __init__ doing essentially the same thing as in __call__. This avoids burdening the first request with the startup cost. Fixes issue2551112. Thanks to Robert Klonner for the patch.
1 parent d217654 commit 009d204

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

roundup/cgi/wsgi_handler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def __init__(self, home, debug=False, timing=False, lang=None):
8484
tracker_home=home)
8585
else:
8686
self.translator = None
87+
# trigger pre-loading of imports and templates
88+
with self.get_tracker():
89+
pass
8790

8891
def __call__(self, environ, start_response):
8992
"""Initialize with `apache.Request` object"""

0 commit comments

Comments
 (0)