comparison roundup/instance.py @ 4211:61cf00ca920a

Process each message through the mail gateway as a separate transaction. The mail-gateway used to process messages fetched, e.g., via imap in a single big transaction. Now we process each message coming in via the mail-gateway in its own transaction. Regression-tests passed. See also discussion: http://thread.gmane.org/gmane.comp.bug-tracking.roundup.user/9500
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Tue, 14 Jul 2009 09:10:43 +0000
parents bbab97f8ffb2
children 2b75274936bc
comparison
equal deleted inserted replaced
4202:e47ec982645b 4211:61cf00ca920a
44 if set, precompile html templates 44 if set, precompile html templates
45 45
46 """ 46 """
47 self.tracker_home = tracker_home 47 self.tracker_home = tracker_home
48 self.optimize = optimize 48 self.optimize = optimize
49 # if set, call schema_hook after executing schema.py will get
50 # same variables (in particular db) as schema.py main purpose is
51 # for regression tests
52 self.schema_hook = None
49 self.config = configuration.CoreConfig(tracker_home) 53 self.config = configuration.CoreConfig(tracker_home)
50 self.actions = {} 54 self.actions = {}
51 self.cgi_actions = {} 55 self.cgi_actions = {}
52 self.templating_utils = {} 56 self.templating_utils = {}
53 self.load_interfaces() 57 self.load_interfaces()
104 } 108 }
105 109
106 if self.optimize: 110 if self.optimize:
107 # execute preloaded schema object 111 # execute preloaded schema object
108 exec(self.schema, vars) 112 exec(self.schema, vars)
113 if callable (self.schema_hook):
114 self.schema_hook(**vars)
109 # use preloaded detectors 115 # use preloaded detectors
110 detectors = self.detectors 116 detectors = self.detectors
111 else: 117 else:
112 libdir = os.path.join(self.tracker_home, 'lib') 118 libdir = os.path.join(self.tracker_home, 'lib')
113 if os.path.isdir(libdir): 119 if os.path.isdir(libdir):
114 sys.path.insert(1, libdir) 120 sys.path.insert(1, libdir)
115 # execute the schema file 121 # execute the schema file
116 self._load_python('schema.py', vars) 122 self._load_python('schema.py', vars)
123 if callable (self.schema_hook):
124 self.schema_hook(**vars)
117 # reload extensions and detectors 125 # reload extensions and detectors
118 for extension in self.get_extensions('extensions'): 126 for extension in self.get_extensions('extensions'):
119 extension(self) 127 extension(self)
120 detectors = self.get_extensions('detectors') 128 detectors = self.get_extensions('detectors')
121 if libdir in sys.path: 129 if libdir in sys.path:

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