svn commit: r1935645 - spamassassin/trunk/masses/rule-qa/automc
[email protected] Thu, 25 Jun 2026 21:09:55 -0000
| Newsgroups | gmane.mail.spam.spamassassin.cvs |
|---|---|
| Message-ID | <178242179569.1153285.18141896887981051696@svn03-he-fi> |
Author: billcole
Date: Thu Jun 25 21:09:55 2026
New Revision: 1935645
Log:
Initial protective stanza added to bail out on excess load
Modified:
spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
Modified: spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi Thu Jun 25 20:37:13 2026 (r1935644)
+++ spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi Thu Jun 25 21:09:55 2026 (r1935645)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/env perl
my $automcdir = "/usr/local/spamassassin/automc/svn/masses/rule-qa/automc";
###!/usr/bin/perl
@@ -9,6 +9,33 @@ use warnings;
my $PERL_INTERP = $^X;
+#----------------------------------------------
+# this is an emergency abuse preventer. 2026-06-25 billcole
+
+open LAF, "</proc/loadavg";
+my $line = <LAF>;
+(my $one, my $five, my $fifteen, my $running, my $iowait) = split (' ', $line);
+
+if (($one > 2) || ($fifteen > 5)) {
+ my $page= q{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "https://www.w3.org/TR/html4/strict.dtd">
+ <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head><meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <link rel="icon" href="https://spamassassin.apache.org/images/favicon.ico">
+ <title> SpamAssassin Rule QA IS OFFLINE</title>
+
+ <link href="https://ruleqa.spamassassin.org/ruleqa.css" rel="stylesheet" type="text/css">
+
+ </head><body>
+ <h1>SpamAssassin Rule QA is OFFLINE due to excessive load. </h1>
+ </body> </html> };
+
+ print $page;
+ exit 0
+}
+#---------------------------------------------------
+
+
our %FREQS_FILENAMES = (
'DETAILS.age' => 'set 0, broken down by message age in weeks',
'DETAILS.all' => 'set 0, broken down by contributor',
@@ -30,6 +57,10 @@ $self->ui_get_rules();
$self->show_view();
exit;
+
+
+
+
# ---------------------------------------------------------------------------
package Mail::SpamAssassin::CGI::RuleQaApp;