summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CGI.pl3
-rw-r--r--globals.pl11
2 files changed, 12 insertions, 2 deletions
diff --git a/CGI.pl b/CGI.pl
index 621bf9111..373572986 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 b4d42e94d..82447389d 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++;
}
}