changeset 6326:0343b6fea4b9

Factor preloading into a preload method
author Ralf Schlatterbeck <rsc@runtux.com>
date Fri, 12 Feb 2021 18:46:27 +0100
parents 3e33b22a3158
children 704a937ac8b7
files roundup/cgi/wsgi_handler.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/wsgi_handler.py	Fri Feb 05 00:09:08 2021 -0500
+++ b/roundup/cgi/wsgi_handler.py	Fri Feb 12 18:46:27 2021 +0100
@@ -84,9 +84,7 @@
                 tracker_home=home)
         else:
             self.translator = None
-        # trigger pre-loading of imports and templates
-        with self.get_tracker():
-            pass
+        self.preload()
 
     def __call__(self, environ, start_response):
         """Initialize with `apache.Request` object"""
@@ -131,6 +129,11 @@
         # all body data has been written using wfile
         return []
 
+    def preload(self):
+        """ Trigger pre-loading of imports and templates """
+        with self.get_tracker():
+            pass
+
     @contextmanager
     def get_tracker(self):
         # get a new instance for each request

Roundup Issue Tracker: http://roundup-tracker.org/