summaryrefslogtreecommitdiffstats
path: root/syncshadowdb
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-29 18:25:41 +0200
committerbbaetz%student.usyd.edu.au <>2002-08-29 18:25:41 +0200
commit4c1922a6e893428bfbd43bc41ff4245384d8b543 (patch)
tree6c55aaa02be826e1352dd2d5be88b5ff61935029 /syncshadowdb
parent90c042db954fe86d555c2d3e413dd70f26d55cd4 (diff)
downloadbugzilla-4c1922a6e893428bfbd43bc41ff4245384d8b543.tar.gz
bugzilla-4c1922a6e893428bfbd43bc41ff4245384d8b543.tar.xz
Bug 163829 - move pref code into a separate package
r=joel, preed
Diffstat (limited to 'syncshadowdb')
-rwxr-xr-xsyncshadowdb18
1 files changed, 11 insertions, 7 deletions
diff --git a/syncshadowdb b/syncshadowdb
index ffe87eea3..cb806bbe0 100755
--- a/syncshadowdb
+++ b/syncshadowdb
@@ -23,6 +23,10 @@
use strict;
+use lib qw(.);
+
+use Bugzilla::Config qw(:DEFAULT :admin);
+
require "globals.pl";
require "defparams.pl";
@@ -106,7 +110,7 @@ if ($shutdown) {
# Record the old shutdownhtml so it can be restored at the end (this will
# only be an issue if we are called using the -force command line param)
$wasshutdown = Param("shutdownhtml");
- $::param{'shutdownhtml'} = $shutdown_msg;
+ SetParam('shutdownhtml', $shutdown_msg);
WriteParams();
# Now we need to wait for existing connections to this database to clear. We
# do this by looking for connections to the main or shadow database using
@@ -143,7 +147,7 @@ if ($shutdown) {
# this happening.
Verbose ("*** Waited for 10 minutes and there were still active \n" .
" connections to the bugzilla database. Giving up.");
- $::param{'shutdownhtml'} = $wasshutdown;
+ SetParam('shutdownhtml', $wasshutdown);
WriteParams();
exit;
}
@@ -153,7 +157,7 @@ if ($shutdown) {
my $wasusing = Param("queryagainstshadowdb");
-$::param{'queryagainstshadowdb'} = 1; # Force us to be able to use the
+SetParam('queryagainstshadowdb', 1); # Force us to be able to use the
# shadowdb, even if other processes
# are not supposed to.
@@ -185,13 +189,13 @@ if (!$syncall) {
if ($syncall) {
Verbose("Syncing up the shadow database by copying entire database in.");
if ($wasusing) {
- $::param{'queryagainstshadowdb'} = 0;
+ SetParam('queryagainstshadowdb',0);
WriteParams();
if (! $shutdown) {
Verbose("Disabled reading from the shadowdb. Sleeping 10 seconds to let other procs catch up.");
sleep(10);
}
- $::param{'queryagainstshadowdb'} = 1;
+ SetParam('queryagainstshadowdb', 1);
}
my @tables;
SendSQL("SHOW TABLES");
@@ -271,12 +275,12 @@ if ($syncall) {
SendSQL("UNLOCK TABLES");
if ($wasusing) {
Verbose("Reenabling other processes to read from the shadow db");
- $::param{'queryagainstshadowdb'} = 1;
+ SetParam('queryagainstshadowdb', 1);
WriteParams();
}
if ($shutdown) {
Verbose("Restoring the original shutdown message (if any)");
- $::param{'shutdownhtml'} = $wasshutdown;
+ SetParam('shutdownhtml', $wasshutdown);
WriteParams();
}
Verbose("OK, done.");