[freeside-commits] freeside/FS/FS queue.pm, 1.22, 1.23 Schema.pm, 1.117, 1.118

Ivan,,, ivan at wavetail.420.am
Sun Dec 21 10:09:57 PST 2008


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv2210/FS/FS

Modified Files:
	queue.pm Schema.pm 
Log Message:
have freeside-queued put billing jobs in the queue, so they run in their own short-lived processes, RT#4423

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- Schema.pm	8 Dec 2008 09:08:44 -0000	1.117
+++ Schema.pm	21 Dec 2008 18:09:55 -0000	1.118
@@ -1439,18 +1439,18 @@
 
     'queue' => {
       'columns' => [
-        'jobnum', 'serial', '', '', '', '', 
-        'job', 'text', '', '', '', '', 
-        '_date', 'int', '', '', '', '', 
-        'status', 'varchar', '', $char_d, '', '', 
-        'statustext', 'text', 'NULL', '', '', '', 
-        'svcnum', 'int', 'NULL', '', '', '', 
-        'secure',  'char', 'NULL', 1, '', '', # Y = needs to be run on machine
-                                              #     w/private key
+        'jobnum',      'serial',     '',      '', '', '', 
+        'job',           'text',     '',      '', '', '', 
+        '_date',          'int',     '',      '', '', '', 
+        'status',     'varchar',     '', $char_d, '', '', 
+        'statustext',    'text', 'NULL',      '', '', '', 
+        'svcnum',         'int', 'NULL',      '', '', '', 
+        'custnum',        'int', 'NULL',      '', '', '',
+        'secure',        'char', 'NULL',       1, '', '',
       ],
       'primary_key' => 'jobnum',
       'unique'      => [],
-      'index'       => [ [ 'svcnum' ], [ 'status' ] ],
+      'index'       => [ [ 'job' ], [ 'svcnum' ], [ 'custnum' ], [ 'status' ] ],
     },
 
     'queue_arg' => {

Index: queue.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/queue.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- queue.pm	21 Dec 2008 17:40:28 -0000	1.22
+++ queue.pm	21 Dec 2008 18:09:55 -0000	1.23
@@ -70,7 +70,18 @@
 
 =item svcnum
 
-Optional link to service (see L<FS::cust_svc>)
+Optional link to service (see L<FS::cust_svc>).
+
+=item custnum
+
+Optional link to customer (see L<FS::cust_main>).
+
+=item secure
+
+Secure flag, 'Y' indicates that when using encryption, the job needs to be
+run on a machine with the private key.
+
+=cut
 
 =back
 
@@ -103,7 +114,7 @@
 
 #false laziness w/part_export.pm
 sub insert {
-  my $self = shift;
+  my( $self, @args ) = @_;
 
   local $SIG{HUP} = 'IGNORE';
   local $SIG{INT} = 'IGNORE';
@@ -116,13 +127,16 @@
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
+  my %args = @args;
+  $self->custnum( $args{'custnum'} ) if $args{'custnum'};
+
   my $error = $self->SUPER::insert;
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
     return $error;
   }
 
-  foreach my $arg ( @_ ) {
+  foreach my $arg ( @args ) {
     my $queue_arg = new FS::queue_arg ( {
       'jobnum' => $self->jobnum,
       'arg'    => $arg,



More information about the freeside-commits mailing list