summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-12-29 00:38:07 +0000
committerivan <ivan>2009-12-29 00:38:07 +0000
commit2d7a236d9e0c3a30193d8b115ea9b3ce22ce7444 (patch)
treef5b82757e40bfb8734b89a9879ce177ab15ed89c /FS
parent03ceab71dad1e5eb366865d304e5e459cc905ce4 (diff)
add queued-sleep_time
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm9
-rw-r--r--FS/bin/freeside-queued5
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 <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply)',
+ 'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (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;
}