From 2d7a236d9e0c3a30193d8b115ea9b3ce22ce7444 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 29 Dec 2009 00:38:07 +0000 Subject: [PATCH] add queued-sleep_time --- FS/FS/Conf.pm | 9 ++++++++- FS/bin/freeside-queued | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 47555a348..eb3238a8d 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -690,7 +690,7 @@ worry that config_items is freeside-specific and icky. { 'key' => 'business-onlinepayment-description', 'section' => 'billing', - 'description' => 'String passed as the description field to Business::OnlinePayment. Evaluated as a double-quoted perl string, with the following variables available: $agent (the agent name), and $pkgs (a comma-separated list of packages for which these charges apply)', + 'description' => 'String passed as the description field to Business::OnlinePayment. Evaluated as a double-quoted perl string, with the following variables available: $agent (the agent name), and $pkgs (a comma-separated list of packages for which these charges apply - not available in all situations)', 'type' => 'text', }, @@ -3168,6 +3168,13 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'queued-sleep_time', + 'section' => '', + 'description' => 'Time to sleep between attempts to find new jobs to process in the queue. Defaults to 10. Installations doing real-time CDR processing for prepaid may want to set it lower.' + 'type' => 'text', + }, + + { 'key' => 'cancelled_cust-noevents', 'section' => 'billing', 'description' => "Don't run events for cancelled customers", diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued index d5d84cced..ffd017a41 100644 --- a/FS/bin/freeside-queued +++ b/FS/bin/freeside-queued @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use vars qw( $DEBUG $kids $max_kids %kids ); +use vars qw( $DEBUG $kids $max_kids $sleep_time %kids ); use POSIX qw(:sys_wait_h); use IO::File; use Getopt::Std; @@ -54,6 +54,7 @@ daemonize2(); my $conf = new FS::Conf; $max_kids = $conf->config('queued-max_kids') || 10; +$sleep_time = $conf->config('queued-sleep_time') || 10; my $warnkids=0; while (1) { @@ -128,7 +129,7 @@ while (1) { undef $FS::UID::dbh; next; }; - sleep 1; + sleep $sleep_time; next; } -- 2.11.0