From: Andrew Dunstan Date: Wed, 19 Jan 2011 03:37:14 +0000 (-0800) Subject: repopulate failures table when a failure is reported X-Git-Url: https://git.exim.org/buildfarm-server.git/commitdiff_plain/2abaa3e3cbcf431d35a2807ae30b0d6f9172ec1c repopulate failures table when a failure is reported --- diff --git a/cgi-bin/pgstatus.pl b/cgi-bin/pgstatus.pl index 52e02df..0c60f80 100755 --- a/cgi-bin/pgstatus.pl +++ b/cgi-bin/pgstatus.pl @@ -401,6 +401,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 '30 days'"); + $db->commit; +} + $db->disconnect; print "Content-Type: text/plain\n\n";