summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-02-18 06:40:54 +0100
committerterry%mozilla.org <>2000-02-18 06:40:54 +0100
commit4ff34e9d3b747097a4bc88efd8171cae832a94e9 (patch)
tree680a7889e3432e5b5dfe2580a2de9f019fa4c0f3 /CGI.pl
parent870be34704d0679153de40192b326b076343ba7d (diff)
downloadbugzilla-4ff34e9d3b747097a4bc88efd8171cae832a94e9.tar.gz
bugzilla-4ff34e9d3b747097a4bc88efd8171cae832a94e9.tar.xz
Added an optional ability to keep a read-only shadow database, so that
bug queries can be run against it, so that these slow queries won't be able to tie up the rest of the system.
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/CGI.pl b/CGI.pl
index 41099661b..621bf9111 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -727,7 +727,10 @@ name=PleaseMailAPassword>
# This seems like as good as time as any to get rid of old
# crufty junk in the logincookies table. Get rid of any entry
# that hasn't been used in a month.
- SendSQL("delete from logincookies where to_days(now()) - to_days(lastused) > 30");
+ if ($::dbwritesallowed) {
+ SendSQL("DELETE FROM logincookies " .
+ "WHERE TO_DAYS(NOW()) - TO_DAYS(lastused) > 30");
+ }
PutFooter();
@@ -735,7 +738,10 @@ name=PleaseMailAPassword>
}
# Update the timestamp on our logincookie, so it'll keep on working.
- SendSQL("update logincookies set lastused = null where cookie = $::COOKIE{'Bugzilla_logincookie'}");
+ if ($::dbwritesallowed) {
+ SendSQL("UPDATE logincookies SET lastused = null " .
+ "WHERE cookie = $::COOKIE{'Bugzilla_logincookie'}");
+ }
return $::userid;
}