diff --git a/webtools/bugzilla/CGI.pl b/webtools/bugzilla/CGI.pl index 621bf91111e..373572986d6 100644 --- a/webtools/bugzilla/CGI.pl +++ b/webtools/bugzilla/CGI.pl @@ -794,7 +794,8 @@ sub PutHeader { sub PutFooter { - print PerformSubsts(Param("footerhtml")); + print PerformSubsts(Param("footerhtml")); + SyncAnyPendingShadowChanges(); } diff --git a/webtools/bugzilla/globals.pl b/webtools/bugzilla/globals.pl index b4d42e94d08..82447389deb 100644 --- a/webtools/bugzilla/globals.pl +++ b/webtools/bugzilla/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++; } }