]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Cut down on the number of syncshadowdb processes we fork off.
authorterry%mozilla.org <>
Sat, 19 Feb 2000 05:38:21 +0000 (05:38 +0000)
committerterry%mozilla.org <>
Sat, 19 Feb 2000 05:38:21 +0000 (05:38 +0000)
CGI.pl
globals.pl

diff --git a/CGI.pl b/CGI.pl
index 621bf91111efcc0e8420a0b1d29320d18d977480..373572986d66b5f62f224b682b962f510be44b4a 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -794,7 +794,8 @@ sub PutHeader {
 
 
 sub PutFooter {
-    print PerformSubsts(Param("footerhtml")); 
+    print PerformSubsts(Param("footerhtml"));
+    SyncAnyPendingShadowChanges();
 }
 
 
index b4d42e94d08761a16da0c68602cf521064ac84fd..82447389deb96d907f24c352107c749ffb813068 100644 (file)
@@ -96,6 +96,15 @@ sub ReconnectToShadowDatabase {
     }
 }
 
+my $shadowchanges = 0;
+sub SyncAnyPendingShadowChanges {
+    if ($shadowchanges) {
+        system("./syncshadowdb &");
+        $shadowchanges = 0;
+    }
+}
+    
+
 my $dosqllog = (-e "data/sqllog") && (-w "data/sqllog");
 
 sub SqlLog {
@@ -137,7 +146,7 @@ sub SendSQL {
         if ($insertid) {
             SendSQL("SET LAST_INSERT_ID = $insertid");
         }
-        system("./syncshadowdb &");
+        $shadowchanges++;
     }
 }