Remove use of Safe.pm now all clients are sending a frozen version of their config.
[buildfarm-server.git] / trunk / cgi-bin / pgstatus.pl
index 481eb5ad3855035488f6938ce6374260eb320996..c9b0268be2c8bf52bd227880763effdcf0d3f117 100755 (executable)
@@ -19,7 +19,6 @@ use DBI;
 use DBD::Pg;
 use Data::Dumper;
 use Mail::Send;
-use Safe;
 use Time::ParseDate;
 use Storable qw(thaw);
 
@@ -209,16 +208,6 @@ if ($frozen_sconf)
 {
     $client_conf = thaw $frozen_sconf;
 }
-else
-{
-    my $container = new Safe;
-    my $sconf = $conf; 
-    unless ($sconf =~ s/.*(\$Script_Config)/$1/ms )
-    {
-       $sconf = '$Script_Config={};';
-    }
-    $client_conf = $container->reval("$sconf;");
-}
 
 if ($min_script_version)
 {
@@ -239,7 +228,7 @@ if ($min_script_version)
        }
 }
 
-if ($min_web_script_version && ! ($client_conf->{script_version} eq 'REL_4.3'))
+if ($min_web_script_version)
 {
        $client_conf->{web_script_version} ||= '0.0';
        my $cli_ver = $client_conf->{web_script_version} ;
@@ -295,6 +284,16 @@ my $logst = <<EOSQL;
     values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
 EOSQL
 ;
+
+
+# this transaction lets us set log_error_verbosity to terse
+# just for the duration of the transaction. That turns off logging the
+# bind params, so all the logs don't get stuffed on the postgres logs
+
+$db->begin_work;
+$db->do("select set_local_error_terse()");
+
+
 $sth=$db->prepare($logst);
 
 $sth->bind_param(1,$animal);
@@ -318,6 +317,8 @@ $sth->bind_param(16,$frozen_sconf,{ pg_type => DBD::Pg::PG_BYTEA });
 $sth->execute;
 $sth->finish;
 
+
+
 my $logst2 = <<EOSQL;
 
   insert into build_status_log 
@@ -348,9 +349,10 @@ foreach my $log_file( @log_file_names )
                  "$stage_interval seconds");
 }
 
-
 $sth->finish;
 
+$db->commit;
+
 my $prevst = <<EOSQL;
 
   select coalesce((select distinct on (snapshot) stage