Database: do not mess with databas for ncrecent_failures view
[buildfarm-server.git] / cgi-bin / eximstatus.pl
index af68f109efb734f5347b57dff9eb0d0ec3290c7c..e471c9224cff57be440eef0db9f73d80fe855a6c 100755 (executable)
@@ -9,6 +9,7 @@ See accompanying License file for license details
 =cut 
 
 use strict;
+use URI::Escape;
 
 use vars qw($dbhost $dbname $dbuser $dbpass $dbport
        $all_stat $fail_stat $change_stat $green_stat
@@ -33,7 +34,7 @@ use Storable qw(thaw);
 use FindBin qw($RealBin);
 require "$RealBin/../BuildFarmWeb.pl";
 
-my $buildlogs = "/home/farm/server/buildlogs";
+my $buildlogs = "$RealBin/../buildlogs";
 
 die "no dbname" unless $dbname;
 die "no dbuser" unless $dbuser;
@@ -76,7 +77,7 @@ if (open($brhandle,"../htdocs/branches_of_interest.txt"))
 
 
 my $content = 
-       "branch=$branch&res=$res&stage=$stage&animal=$animal&".
+       'branch=' . uri_escape($branch) . "&res=$res&stage=$stage&animal=$animal&".
        "ts=$ts&log=$log&conf=$conf";
 
 my $extra_content = 
@@ -446,15 +447,16 @@ $db->do("delete from dashboard_mat");
 $db->do("insert into dashboard_mat select * from dashboard_mat_data");
 $db->commit;
 
-if ($stage ne 'OK')
-{
-       $db->begin_work;
-       # prevent occasional duplication by forcing serialization of this operation
-       $db->do("lock table nrecent_failures in share row exclusive mode");
-       $db->do("delete from nrecent_failures");
-       $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '90 days'");
-       $db->commit;
-}
+
+#if ($stage ne 'OK') # On Exim build farm nrecent_failures is a view, not table... comment out
+#{
+#      $db->begin_work;
+#      # prevent occasional duplication by forcing serialization of this operation
+#      $db->do("lock table nrecent_failures in share row exclusive mode");
+#      $db->do("delete from nrecent_failures");
+#      $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '90 days'");
+#      $db->commit;
+#}
 
 $db->disconnect;