Skip to content

Commit 8905d7a

Browse files
committed
Factor preloading into a preload method
1 parent e34547c commit 8905d7a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

roundup/cgi/wsgi_handler.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ 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
87+
self.preload()
9088

9189
def __call__(self, environ, start_response):
9290
"""Initialize with `apache.Request` object"""
@@ -131,6 +129,11 @@ def __call__(self, environ, start_response):
131129
# all body data has been written using wfile
132130
return []
133131

132+
def preload(self):
133+
""" Trigger pre-loading of imports and templates """
134+
with self.get_tracker():
135+
pass
136+
134137
@contextmanager
135138
def get_tracker(self):
136139
# get a new instance for each request

0 commit comments

Comments
 (0)