You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/04/29 18:13:31 UTC

svn commit: r398193 - /spamassassin/trunk/build/automc/freqsd

Author: jm
Date: Sat Apr 29 09:13:22 2006
New Revision: 398193

URL: http://svn.apache.org/viewcvs?rev=398193&view=rev
Log:
support impatience

Modified:
    spamassassin/trunk/build/automc/freqsd

Modified: spamassassin/trunk/build/automc/freqsd
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/build/automc/freqsd?rev=398193&r1=398192&r2=398193&view=diff
==============================================================================
--- spamassassin/trunk/build/automc/freqsd (original)
+++ spamassassin/trunk/build/automc/freqsd Sat Apr 29 09:13:22 2006
@@ -1,4 +1,7 @@
 #!/local/perl586/bin/perl
+#
+# freqsd - perform "background" operations required by the automc
+# infrastructure, such as building indices and "hit-frequencies" reports
 
 use strict;
 use warnings;
@@ -91,6 +94,7 @@
 
 $| = 1;
 logit "freqsd starting";
+my $is_first_time = 1;
 
 if ($am_parent) {
   while (1) {
@@ -107,7 +111,18 @@
 # ---------------------------------------------------------------------------
 
 sub parent_loop {
-  my $job = $dq_fast->wait_for_queued_job($idle_sleep);
+  # I'm impatient.  many times when I have to restart this script, I want to
+  # see "faster" report results built immediately, without the 10-minute wait.
+  # So first time around, just sleep for 5 secs, so that we get started almost
+  # immediately.
+
+  my $this_sleep = $idle_sleep;
+  if ($is_first_time) {
+    $is_first_time = 0;
+    $this_sleep = 5;
+  }
+
+  my $job = $dq_fast->wait_for_queued_job($this_sleep);
 
   if ($job && $job->{metadata}->{dir}) {
     # if a dir was specified, it's always a "b" (buildbot) mass-check;
@@ -126,7 +141,6 @@
   run ("cd masses ; ./rule-qa/automc/gen_info_xml");
 
   logit "completed faster reports";
-
   if ($job) { $job->finish(); }
 }