[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] You can't go wrong with 1;



You can never have too many "1;" lines in your programs.

I have no idea why I put that there 21 months ago. :)

j




SLEEP: while (sleep $sleephack) {
   $debug && print "\n\nI'm awake!\n";
   $sleephack = $sleep;
   my $running = running();
   next if ($running >= $max_rcvlbmns_to_run);

   if (keys %waiting < $max_rcvlbmns_to_run - $running) {
      %waiting = get_waiting_list();
   }

   1;
   RUNONE: for (1..$max_rcvlbmns_to_run - $running) {
      last unless %waiting;
      $number_checked = 0;
      my $next_to_run = next_to_run(%waiting);
      $debug && print "Run $next_to_run\n";
      system("nice -n 20 /oexec/__obin/rcvlbmn.4ge $next_to_run &");
      delete $waiting{$next_to_run};
   }
   $debug && print "Sleeping now.\n";
   $debug && print "I still know of " . scalar(keys %waiting) . " props
waiting.\n";
}