[Python-checkins] r81161 - tracker/roundup-src/roundup/scripts/roundup_server.py
martin.v.loewis
python-checkins at python.org
Fri May 14 12:32:59 CEST 2010
Author: martin.v.loewis
Date: Fri May 14 12:32:59 2010
New Revision: 81161
Log:
Add logging for in-progress requests.
Modified:
tracker/roundup-src/roundup/scripts/roundup_server.py
Modified: tracker/roundup-src/roundup/scripts/roundup_server.py
==============================================================================
--- tracker/roundup-src/roundup/scripts/roundup_server.py (original)
+++ tracker/roundup-src/roundup/scripts/roundup_server.py Fri May 14 12:32:59 2010
@@ -233,7 +233,22 @@
traceback.print_exc()
sys.stdin = save_stdin
- do_GET = do_POST = do_HEAD = run_cgi
+ def run_cgi_outer(self):
+ "Log requests that are in progress"
+ if self.CONFIG and self.CONFIG['LOGFILE']:
+ jobfile = os.path.join(os.path.dirname(self.CONFIG['LOGFILE']), str(os.getpid()))
+ try:
+ f = open(jobfile, "w")
+ f.write(self.path)
+ f.close()
+ return self.run_cgi()
+ finally:
+ pass
+ #os.unlink(jobfile)
+ else:
+ return self.run_cgi()
+
+ do_GET = do_POST = do_HEAD = run_cgi_outer
def index(self):
''' Print up an index of the available trackers
More information about the Python-checkins
mailing list