зеркало из https://github.com/mozilla/pjs.git
Cut down on the number of syncshadowdb processes we fork off.
This commit is contained in:
Родитель
2c574ae9cf
Коммит
c06b86600d
|
@ -795,6 +795,7 @@ sub PutHeader {
|
||||||
|
|
||||||
sub PutFooter {
|
sub PutFooter {
|
||||||
print PerformSubsts(Param("footerhtml"));
|
print PerformSubsts(Param("footerhtml"));
|
||||||
|
SyncAnyPendingShadowChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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");
|
my $dosqllog = (-e "data/sqllog") && (-w "data/sqllog");
|
||||||
|
|
||||||
sub SqlLog {
|
sub SqlLog {
|
||||||
|
@ -137,7 +146,7 @@ sub SendSQL {
|
||||||
if ($insertid) {
|
if ($insertid) {
|
||||||
SendSQL("SET LAST_INSERT_ID = $insertid");
|
SendSQL("SET LAST_INSERT_ID = $insertid");
|
||||||
}
|
}
|
||||||
system("./syncshadowdb &");
|
$shadowchanges++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче