From: terry%mozilla.org <> Date: Sat, 19 Feb 2000 05:38:21 +0000 (+0000) Subject: Cut down on the number of syncshadowdb processes we fork off. X-Git-Tag: bugzilla-2.12~369 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=22ddb05983a4f3fc1e94444c997ec8d118af70bd;p=thirdparty%2Fbugzilla.git Cut down on the number of syncshadowdb processes we fork off. --- diff --git a/CGI.pl b/CGI.pl index 621bf91111..373572986d 100644 --- a/CGI.pl +++ b/CGI.pl @@ -794,7 +794,8 @@ sub PutHeader { sub PutFooter { - print PerformSubsts(Param("footerhtml")); + print PerformSubsts(Param("footerhtml")); + SyncAnyPendingShadowChanges(); } diff --git a/globals.pl b/globals.pl index b4d42e94d0..82447389de 100644 --- a/globals.pl +++ b/globals.pl @@ -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++; } }